0

There are some limitations which are imposed by Google in newer versions of the Android and I do not want people to give bad reviews about the app on PlayStore. So, how to can I exclude the newer version of the Android

  • [Google Doc](https://developer.android.com/distribute/best-practices/develop/target-sdk) says 29 or higher, nothing below that. – rahat Jan 12 '21 at 04:08
  • target version it self is highest version.. you can allow features of that OS, that will be supported on even greater version of android. – NehaK Jan 12 '21 at 06:24
  • The target sdk version is the version of Android that your app was created to run on. – NehaK Jan 12 '21 at 06:24
  • read yoAlex5's answer here : https://stackoverflow.com/questions/24510219/what-is-the-difference-between-min-sdk-version-target-sdk-version-vs-compile-sd – NehaK Jan 12 '21 at 06:26
  • Can you give examples of these limitations? – xjcl Jan 12 '21 at 06:42
  • For example, i downloaded a project from github, it works fine till API level 28, but do not run properly on 29 and 30 – Nooraib Khurshid Jan 12 '21 at 08:21

1 Answers1

0

You can use maxSdkVersion.

From https://developer.android.com/guide/topics/manifest/uses-sdk-element#max:

android:maxSdkVersion

An integer designating the maximum API Level on which the application is designed to run.

In Android 1.5, 1.6, 2.0, and 2.0.1, the system checks the value of this attribute when installing an application and when re-validating the application after a system update. In either case, if the application's maxSdkVersion attribute is lower than the API Level used by the system itself, then the system will not allow the application to be installed. In the case of re-validation after system update, this effectively removes your application from the device.

To illustrate how this attribute can affect your application after system updates, consider the following example:

An application declaring maxSdkVersion="5" in its manifest is published on Google Play. A user whose device is running Android 1.6 (API Level 4) downloads and installs the app. After a few weeks, the user receives an over-the-air system update to Android 2.0 (API Level 5). After the update is installed, the system checks the application's maxSdkVersion and successfully re-validates it. The application functions as normal. However, some time later, the device receives another system update, this time to Android 2.0.1 (API Level 6). After the update, the system can no longer re-validate the application because the system's own API Level (6) is now higher than the maximum supported by the application (5). The system prevents the application from being visible to the user, in effect removing it from the device.

Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.

Maurice Lam
  • 1,577
  • 9
  • 14
  • you missed one point, Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. – NehaK Jan 12 '21 at 06:25
  • That's the last paragraph I quoted from the documentation. Thanks for calling it out though, I think it's important enough to mention it twice :) – Maurice Lam Jan 12 '21 at 06:30