The app that I have in the store right now does not work quite right in ICS. While I fix it I would like to block users who have ICS from downloading and buying it. I emailed Google and they say that this is possible but they are vague about how to do it. I know how to put a Minimum SDK so that only people who have version x or above can download the app, but I cannot seem to locate how to do that in reverse. Is this possible?
Define android:maxSdkVersion in your manifest to restrict the upper limit.
For example:
<uses-sdk android:minSdkVersion="8" android:maxSdkVersion="10"/>
Now the app will only be available for devices running Froyo and Gingerbread versions of Android.
http://developer.android.com/guide/appendix/market-filters.html
You can set filters in the market. i.e. ICS user wont see your app ^^
Use android:maxSdkVersion="13" in your manifest
Check this page on the Android Developers documentation.
Just as you can set a minimum SDK version, you can set a maximum SDK version:
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
You can define a maxSdkVersion with the uses-sdk tag in the AndroidManifest.xml file. It is documented in the developers guide.
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
Related
We know that uses-sdk attributes in the manifest file can be set for filtering on Google Play:
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
and android:minSdkVersion can prevent app from installing on Android OS.
However android:maxSdkVersion is deprecated from Android 2.1 (API7), so it won't be recognized by Android OS anymore.
Then, what is the best way to set an upper limit of Android API version for running an app?
I have developed on Android application using sdk 2.2. Is it possible to migrate my application to higher version without re-coding. If yes, please let me know the procedure.
No, you don't have to recode it.
Just change in manifest file as,
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14"
/>
I need to suppoert api level 10, and working with latest sdk to provide new device features (only if sdk of device is new).
on manifest I choose min version 10.
The problem is that the application is not installed succesfully on the old sdk devices.
Whne I debug on those devices it works, The installation of signed aok fails.
Any suggestions?
Use this in your manifest file
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
If your application uses any API's that are not available on older Android versions, then you should try to use Support Libraries or just give up on those devices. If the application does run on older emulators in debug mode, then you can just change the minSdkVersion in the manifest to a lower one. Hope this helps.
in my app i have two set of designs. One design is for the android devices version of 2.1 and 2.2, the other design is for devices of 2.3 and above.
Now the problem is i take a build setting as follows in my manifest file
<uses-sdk android:minSdkVersion="7" />
<uses-sdk android:maxSdkVersion="8" />
My android project properties in been set to 2.2. When i run this build in 2.3.4 devices it gets run properly. How does it happens?
I am planning to submit the app with multiple apk files in market. How to block my apps
one build to be run in 2.1 and 2.2 and
the other build to get run in 2.3 and above
I just tried setting only <uses-sdk android:minSdkVersion="7" /> or <uses-sdk android:maxSdkVersion="7" /> or <uses-sdk android:maxSdkVersion="8" /> or
<uses-sdk android:targetSdkVersion="8" /> then also it gets run in all devices of 2.3.4 devices
Please help me friends....
Hey as per the android documentation :
Introduced in: API Level 4
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.
You might want to have a look at last few lines of this link
EDIT1:
Also have a look at the Warning
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.
According to documentation:
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#max
Alternatively, you can check API version at runtime and block the use of your app.
http://developer.android.com/reference/android/os/Build.VERSION.html
You can install it using the adb or directly downloading the apk through a website.
The minSdk and maxSdkVersion is checked only when its installed from Android market. Devices with versions out of this range will not see your app in the market.
You need to use PackageManager Class for Version Specific Application. There is a method called getPackageInfo() which returns an object of PackageInfo. From this PackageInfo, you can fetch values of Version Name & Code.
Now you have values, so use logic and implement it
I currently have an app which is set to support Android 2.2 and have the Android Manifest file the line of code to enable the app to be installed on to the SD Card. I want to be able to make the App also support Android 2.1 and above. Is there a way I can do this or do I need to have two separate apps. One for Android 2.1 and another for 2.2 and above.
Thanks for your help
No.
Simply in the Manifest editor add the uses-sdk in "Manifest extras" and set only the minSdkVersion attribute to an API version of your choice. Don't set the Targetsdkversion.
This works for my apps.
I set:
android:installLocation="auto"
and
<uses-sdk android:minSdkVersion="7"/>
You can find all this information on the Android dev guide