android.support library找不到的解决方法

Downloading the Support Package



The Support Package is provided as a downloadable package from the Android SDK Manager. To install:

  1. Launch the Android SDK Manager.

    From Eclipse, you can select Window > Android SDK Manager. Or, launch SDK Manager.exe from the <sdk>/ directory (on Windows only) or android from the <sdk>/tools/ directory.
  2. Expand the Android Repository, check Android Support package and click Install selected.
  3. Proceed to install the package.

When done, all files (including source code, samples, and the .jar files) are saved into the<sdk>/extras/android/support/ directory. This directory contains each of the different support libraries, such as the library for API level 4 and up and the library for API level 13 and up, each named with the respective version (such as v4/).

Setting Up a Project to Use a Library



To add one of the libraries to your Android project:

  1. In your Android project, create a directory named libs at the root of your project (next to src/res/, etc.)
  2. Locate the JAR file for the library you want to use and copy it into the libs/ directory.

    For example, the library that supports API level 4 and up is located at<sdk>/extras/android/support/v4/android-support-v4.jar.
  3. Add the JAR to your project build path.

    In Eclipse, right-click the JAR file in the Package Explorer, select Build Path > Add to Build Path.

Your application is now ready to use the library APIs. All the provided APIs are available in the android.supportpackage (for example, android.support.v4).

Tip: To see the library APIs in action, take a look at the sample apps in<sdk>/extras/android/support/<version>/samples/.

Warning: Be certain that you not confuse the standard android packages with those in android.support library. Some code completion tools might get this wrong, especially if you're building against recent versions of the platform. To be safe, keep your build target set to the same version as you have defined for your android:minSdkVersion and double check the import statements for classes that also exist in the support library, such as SimpleCursorAdapter.

Using the v4 Library APIs



The support library for v4 provides access to several classes introduced with Android 3.0 and beyond, plus some updated version of existing classes, and even some APIs that currently don't exist in the Android platform. Some of the most useful and notable classes that have counterparts in the v4 support library are:

For each of the classes above (and others not listed), the APIs work almost exactly the same as the counterparts in the latest Android platform. Thus, you can usually refer to the online documentation for information about the supported APIs. There are some differences, however. Most notably:

Tip: To enable the Holographic theme on devices running Android 3.0 or higher, declare in your manifest file that your application targets API level 11, for example:

<uses-sdkandroid:minSdkVersion="4"android:targetSdkVersion="11"/>

This way, your application automatically receives the Holographic theme and the Action Bar for each activity when running on Android 3.0 and higher.

For more information about how you can optimize your application for the latest Android-powered devices, readOptimizing Apps for Android 3.0.

Reference Docs



The reference documentation for the Support Packages is included as part of the Android online developer documentation:

Samples



If you want to see some code that uses the support libraries, samples are included with the Support Package, inside each support library directory, for example; <sdk>/extras/android/support/v4/samples/. You can also view these samples as part of the Android online developer documentation:

Additionally, the Google I/O App is a complete application that uses the v4 support library to provide a single APK for both handsets and tablets and also demonstrates some of Android's best practices in Android UI design.

欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 330987132 | Go:217696290 | Python:336880185 | 做人要厚道,转载请注明出处!http://www.cnblogs.com/sunshine-anycall/archive/2013/02/21/2919882.html

时间: 2024-09-03 17:33:26

android.support library找不到的解决方法的相关文章

Android Support Library 标题栏(Toolbar)滚动效果实现方法

首先来个效果图 布局文件代码 在布局文件中,CoordinatorLayout作为布局文件根节点,AppBarLayout包含在CoordinatorLayout中,toolbar在AppBarLayout节点下include进来. <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="h

sdk管理器中没有Android support library

问题描述 sdk管理器中没有Android support library 初学安卓开发.在搭建环境时候出现问题.创建工程时出现下面的问题,上网查了一番之后发现我sdk管理器中并没有Android support library的下载,求告知怎么解决,谢谢

Android添加glide库报错Error: Failed to resolve: com.android.support:support-annotations:26.0.2的解决

前言 Glide是 Google推荐的图片加载库,它可以支持来自url,Android资源,文件,Uri中的图片加载,同时还支持gif图片的加载,以及各种图片显示前的bitmap处理(例如:圆角图片,圆形图片,高斯模糊,旋转,灰度等等),缓存处理,请求优先级处理,动画处理,缩略图处理,图片大小自定义等等.可谓是非常的强大. 在Glide的使用方面,它和Picasso的使用方法是比较相似的,并且他们的运行机制也有很多相似的地方,很多博文会把二者进行比较,此文也采取一样的方式,通过比较二者来学习他们

解析ADT-20问题 android support library

this template depends on the android support library,which is either not installed,or the template depends on a more recent version thanthe one you have installed. Required version :8 安装提示我点 install 了,但安装后console里面显示的是 Installed Android Support Libra

Android Beam 文件传输失败分析与解决方法

最近在修改Android7.0原生平台的一些bug,其中有关Android Beam传输文件的一些问题还是蛮多的.所以特地找时间总结下曾经踏过的坑. 1.传输的文件名包含中文时,导致传输失败 可能是由于Google未考虑到本地化差异,导致在传输中文文件名的文件时直接提示传输失败. packages\apps\Nfc\src\com\android\nfc\beam\MimeTypeUtil.java 其实,上面忘了说了,只是从文件管理器中进入Android Beam分享才会出现上面的问题.因为当

win8.1点击微软拼音简捷输入选项提示windows找不到文件解决方法

  win8.1点击微软拼音简捷输入选项提示windows找不到文件解决方法.有用户反馈在Win8.1的控制面板中查找"输入法",然后点击"微软拼音简捷输入选项"竟然弹出错误提示:windows找不到文件,为什么会出现这样情况呢?针对此问题,小编和大家分享详细的原因和解决方法. 原因分析: 这是确实是微软设计失误造成的,从 Windows 8.1 开始微软拼音输入法和操作系统深度整合,于是修改了 Windows 8 中独立的微软拼音设置面板,但却"忘了&q

mini.msi找不到的解决方法

  mini.msi不是安装中必须的文件,出现 是由于你的系统文件被Ghost Xp系统是修改了. mini.msi找不到的解决方法: 方法1: 开始--运行--regedit回车--依次找到HKEY_CURRENT_USERSoftwareMicrosoftInstallerProducts762812C5FEEC1B428F26679F2DFAE7C---删除0762812C5FEEC1B428F26679F2DFAE7C,相信我的话你不用备份. 这样不需要MINI.msi也能用了! 方法2

mini.msi缺少、mini.msi找不到的解决方法

mini.msi不是安装中必须的文件,出现 是由于你的系统文件被Ghost Xp系统是修改了. mini.msi找不到的解决方法: 方法1: 开始--运行--regedit回车--依次找到HKEY_CURRENT_USERSoftwareMicrosoftInstallerProducts762812C5FEEC1B428F26679F2DFAE7C---删除0762812C5FEEC1B428F26679F2DFAE7C,相信我的话你不用备份. 这样不需要MINI.msi也能用了! 方法2:

bluetooth外围设备找不到驱动程序解决方法

bluetooth外围设备找不到驱动程序解决方法来咯~如果你在使用蓝牙手机连接笔记本后在设备管理器出现Bluetooth外围设备无法驱动的提示,可以试一试下文提供的解决方法哦~ --Windows 7系统解决方案 1. 右键右下角的蓝牙图标单击显示Bluetooth设备; 2. 右键配对过的蓝牙设备后单击删除设备,Bluetooth外围设备消失. --Windows 8系统解决方法 知识点分析: 在"设备管理器中"有未安装的" Bluetooth 外围设备"显示叹号