简体   繁体   中英

What are the disadvantages of using a lower minimum API level?

In my project we should support RTL feature and I will use custom map (created with unity). And project should support bluetooth feature. I want to use min 19 version or min 16 version in my project. So What is disadvantages of using 16 minimum API level for my project?

is there any issue about apk size?

is there any issue about RTL support?

is there any issue about bluetooth support?

is there any issue should be anything else you know?

Lower API Levels generally give you less access to newer features that are built into the Android SDK. A lot of times, this isn't a huge issue, because there are Compatability classes that ship with AndroidX / Android Support Libraries that bridge the gap but there are cases when this isn't so.

If you're supporting a lower API level, you should absolutely make sure you thoroughly test the app on a device at that API level, and you should ideally be linting your code to make sure you don't accidentally utilize newer APIs.

Examples:

// Newer API levels:
SomeServiceManager s = context.getSystemService(SomeServiceManager.class)

// Older API levels:
SomeServiceManager s = (SomeServiceManager) context.getSystemService(Context.SOME_SERVICE_MANAGER)

// Compat:
SomeServiceManager s = ContextCompat(context, SomeServiceManager.class)

Using higher api minSdkVersion usually results in less development efforts as you don't have to use support libraries for features that became available afte api 16. You should consider version distribution stats here https://developer.android.com/about/dashboards/index.html This will allow you to safely discard some older devices if you consider that their share is low.

targetSdkVersion is quite important though as Google officially claims that updating to target the latest SDK should be a high priority for every app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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