Android studio has many APIs. But some of them have been added from API 13 or API 17 or API 20 or the higher APIs. If I set the minimum API to the 7
, do I can not use the higher APIs in my project and they can work in android 2.1 well? If the answer is yes, please explain that how can I do this?
Take a look here: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
My advice is to set the TargetSdkVersion always to the latest api version available. The minSdkVersion depends on which platform you want to support at least. If you want to use the newer api calls in your methods, you can annotate them with
@TargetApi(Build.version)
But note that these calls will ONLY work at devices with the same or higher api version (and you do need to check this yourself before calling such a method, otherwise the application will probably crash).
Note that for some API calls it is possible to use the android compatibility package (http://developer.android.com/tools/support-library/index.html) that makes some newer calls/design library's available for older API's.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments