Restrict app installation for particular version of android - android

I am working on android app. Can anybody tell me that how can we restrict our app installation in android version less than 4.0 from google play developer console.

This is not set in Google Play developer console, it is set in the project's build gradle.
The setting is in build.gradle file in your application module. There should be something like this.
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
change minSdkVersion to whatever value of sdk you want to support.
Read more here: https://developer.android.com/studio/publish/versioning.html#minsdkversion
And here are the sdk int value for each Android version: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels

There is no way that I know of to manage that in Developer Console. You should upload binary that was packaged with Minimum Android Version set in AndroidManifest.xml to what ever is the minimum you still want to support (4.0 in your case).
Example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="14" />
</manifest>
14 is the API Level of Android 4.0.

Related

How to restrict App for specific Android versions in Google Play Console

I have an older app that gives errors on devices with the new Android 7.0.
The app is published already and I cannot update the app actually.
How can I restrict the app for specific Android versions in the Google Play Console ?
In the play console you can only block apps for regions or specific devices.
If you really can't upload updates your best bet is to start excluding devices of which you know they have received an Android 7 update. Not recommended.
Blocking an app for an API level will require a deploy since it's done in the manifest file (in gradle config).
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ... >
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
...
</manifest>
From Supporting Different Platform versions.
An overview of all the current API levels can be found at What is API level.
When configured in Gradle it will look similar to the following snippet of a your_app_module/build.gradle file. Note that in the final result, the compile APK this will be part of the manifest.
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "your.app.id.here"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "0.1.0"
}

play store set apilevel 14-19 automatically

I uploaded an APK to the app store, it's targeting lollipop, but on Google Play Store it says "API levels 14-19". I can't seem to figure out why the max sdk level is stuck at 19.
compileSdkVersion 22 buildToolsVersion "21.1.2"
defaultConfig {
applicationId "be.appwise.test"
minSdkVersion 14
targetSdkVersion 21
versionCode 15
versionName "1.0"
Check your AndroidManifest.xml for <uses-sdk android:maxSdkVersion="19"/> Maybe you're using a library which specified this.
Google Play store will use this attribute for filtering however the attribute is generally not needed. From the docs:
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.
If you want to remove the attribute try one of these inside the AndroidManifest.xml:
<uses-sdk tools:overrideLibrary="the library package name" />
<uses-sdk tools:node="replace" />
Disclaimer: I haven't tested these so I don't know if they work or have any side effects. Please report any results.

Google play: required android version doesn't match manifest minSdk version

I published my app to beta in google play.
But in manifest specified another version:
<uses-sdk android:minSdkVersion="10"/>
Anyone else encountered this problem? What could it be?
Update: I extracted the manifest from apk. minSdkVersion in it = 10.
May be it is a feature of beta testing?
Update 2: After publishing app to production "Requires Android" changed to specified in manifest
It's only in alpha and beta testing. I had a similar issue. Later, after promoting it to production, it began showing correct sdk version. So it might be some bug in alpha and beta testing.
Are you using Android Studio?
If that's the case, check your build.gradle file. It also defines a minSdkVersion and overrides the one of your manifest:
apply plugin: 'android'
android {
// ...
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
//...
}
//...
}
The fact that Size and Current Version "vary with device" makes me think you have multiple active APKs. One that perhaps you initially uploaded that supports 1.6, and then the latest one which supports 2.3.3. Go the APKs section for your app in your android dev/publishing console and make sure you only have a single APK "in production".
If you use Android Studio you have to set build.gradle file.
Set your gradle in defaultConfig and retry:
apply plugin: 'android'
android {
// ...
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.01"
}
//...
}
1.add following inside application tag of AndroidManifest.xml
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
2. we can directly add the version code like
<meta-data android:name="com.google.android.gms.version" android:value="4030500" />
4030500 is version code which is stored inside google-play-services_lib>res>values>version.xml
Like
<integer name="google_play_services_version">4030500</integer>
Conclusion: Latest google play services requires a version name, which is to be mentioned using inside AndroidManifest.xml
Note: I would strongly recommend to use 1st way

Setting maximum TargetSDK for the apk

I have a app on the Google Play with the following configuration. Till now I thought that Google Play uses AndroidManifest to determine the minimum and the maximum SdkVersion. Unfortunately as it reveals people could download and install this app on higher APIs.
The question is; how to set maximum API limit for this app (I guess I need to set compileSdkVersion 17 in build.gradle but I have to be sure) before publish the apk.
AndroidManifest.xml (an extract):
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
build.gradle (an extract):
android {
compileSdkVersion 19
//...
}
You are setting targetSdk Version and minSdkVersion
maxSDK Version is a different attribute.
but is discouraged to set it
heres the full version of the code, from developer.android.com
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
As the Google play store indirectly choose the version ,after upload of the apk it looks after our android manifest.xml from there it takes all the information like minsdkversion and maxsdkversion in that manner our app will support based on that values it contain..

In IntelliJ, how to set the Android API level

I'm using the latest and greatest IntelliJ Community edition. My application runs fine on the android emulator. However, I need the emulator to better match the Kindle Fire. I made the configuration changes in the AVD Manager (including setting device to API 10.)
When I went to my project to configure the project to target the new virtual device, I got the following message: "Build target of AVD DEV3 is not compatible with your build target."
It didn't take much work to figure out that the issue is related to my choice of API 10.
I don't know where I tell my project to use API 10. I looked all over and didn't see any references to the API level at all. Any ideas?
EDIT
I added
<uses-sdk android:minSdkVersion="10" />
to my AndroidManifest.xml file and was able to select the new device. I'm starting it up now.
The answer above is no longer true in Intellij (using gradle)
Now <uses-sdk> is ignored in the AndroidManifest.xml, it is automatically added to the built manifest file. To change the version, go to the 'build.gradle' file and look at the minSdkVersion.
As Tony and Blundell mention, the answer is to declare your minSdkVersion in your AndroidManifest.xml file. In this way, the application will be allowed to launch on any AVDs that at least meet the minSdkVersion.
Here's more documentation on the <uses-sdk> tag:
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
Set this value in the Gradle file - as shown here:
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.kotlinconverterapp"
**minSdkVersion 26**
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Categories

Resources