Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the effect of using targetSDKVersion in Android

Tags:

android

This is an abstract from the Android docs regarding the targetSDKVersion attribute of the uses-sdk element in the AndroiManifes.xml file.

With this attribute set, the application says that it is able to run on older versions (down to minSdkVersion), but was explicitly tested to work with the version specified here. Specifying this target version allows the platform to disable compatibility settings that are not required for the target version (which may otherwise be turned on in order to maintain forward-compatibility) or enable newer features that are not available to older applications.

Can anyone explain what forward-compatibility means in this context, or come up with examples of "compatibility settings" that can be disabled?

like image 899
Glenn Bech Avatar asked Dec 27 '22 09:12

Glenn Bech


1 Answers

This is mainly useful for stating that you support and adapting to big OS jumps, for example, you can design an app that can run from 1.6 to 3.2, without saying the target version is 11+, and it will work, but in API Version 11 and up, you will be runing in compatibility mode, where the tablet will ask you if you want to strech or zoom the app to fit to the screen.

If you set target version to 11, the system will understand that you have actually done something to adapt to that API level, so you will not be presented the option to zoom or strech, instead it just uses it like it would if it were desinged only for 3.0+

like image 101
blindstuff Avatar answered Jan 15 '23 09:01

blindstuff