0

is it possible to set the Minumum SDK and target SDK versions in code for an Android Application? Normally this is specified in the Manifest.xml file

1
  • 1
    Why would you want to do that? Commented Jul 18, 2013 at 15:58

2 Answers 2

4

No it is not, the system should be able to read it before it runs your application.

When preparing to install your application, the system checks the value of this attribute and compares it to the system version. If the android:minSdkVersion value is greater than the system version, the system aborts the installation of the application. Similarly, the system installs your application only if its android:maxSdkVersion is compatible with the platform version.

If you do not specify these attributes in your manifest, the system assumes that your application is compatible with all platform versions, with no maximum API Level.

Sign up to request clarification or add additional context in comments.

Comments

0

I do not believe this is possible. This information is used in determining if your application can even run on a particular device based on the OS. How can you run an application and then determine if it is ok based on the OS.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.