简体   繁体   English

什么是Android支持库?

[英]What is an Android Support Library?

What is the purpose of an Android Support Library? Android支持库的目的是什么?

Does this mean http://developer.android.com/tools/extras/support-library.html ? 这是否意味着http://developer.android.com/tools/extras/support-library.html

Currently my app minSdkVersion is restricted to level 10. 目前我的应用程序minSdkVersion仅限于10级。

I am trying to use ViewPager , which is not available for a higher API (for example for level 16)... 我正在尝试使用ViewPager ,它不适用于更高的API(例如16级)...

What does this support library mean? 这个支持库意味着什么? Does it mean I can use ViewPager , and the user of the phone with API level less than 16 can still see ViewPager widget? 这是否意味着我可以使用ViewPager ,API级别低于16的手机用户仍然可以看到ViewPager小部件?

From the description of the support library: 从支持库的描述:

The Support Package includes static "support libraries" that you can add to your Android application in order to use APIs that are either not available for older platform versions or that offer "utility" APIs that aren't a part of the framework APIs. 支持包包括静态“支持库”,您可以将其添加到Android应用程序中,以便使用不适用于较旧平台版本的API,或者提供不属于框架API的“实用程序”API的API。 The goal is to simplify your development by offering more APIs that you can bundle with your application so you can worry less about platform versions. 目标是通过提供可以与应用程序捆绑在一起的更多API来简化开发,这样您就可以减少对平台版本的担忧。

Off course you have to use only the lower SDK available functions. 当然,您只能使用较低的SDK可用功能。 You should also look the Google Support Library thats make available some new functions for older SDK. 您还应该查看Google支持库,它为旧版SDK提供了一些新功能。 http://developer.android.com/tools/extras/support-library.html http://developer.android.com/tools/extras/support-library.html

Yes, support package will allow you to use most of the fragment widgets back to Android 1.6. 是的,支持包将允许您将大多数片段小部件用于Android 1.6。 With NineOldDroids ( http://nineoldandroids.com/ ) and other packages such as ActionBarSherlock ( http://actionbarsherlock.com/ ) from the same developer, you can get a lot of the goodies from ICS and above to work on old Android devices. 使用NineOldDroidshttp://nineoldandroids.com/ )和其他软件包(例如来自同一开发人员的ActionBarSherlockhttp://actionbarsherlock.com/ )),您可以从ICS及以上版本获得很多好东西来处理旧版Android设备。

All you have to do is to import the compatibility libraries. 您所要做的就是导入兼容性库。 The way they work is that for the new devices, they will use official Android API, for the old ones, they will simulate and run them in compatible ways, so things may look different. 他们的工作方式是,对于新设备,他们将使用官方Android API,对于旧设备,他们将以兼容的方式模拟和运行它们,因此事情可能看起来不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM