I want update the Application on playstore with changed targetSdkVersion - android

I have already updated an app to playstore with below-mentioned uses-SDK:
<uses-sdk
android:maxSdkVersion="23"
android:minSdkVersion="17"
android:targetSdkVersion="23"/>
I want to downgrade my targetSdkVersion "23" to "22". I've done it. if I upload to playstore, will the update work for all the users properly?

You won't have any problem at all. What you are saying with your <uses-sdk> is that your app is fully tested to run in version 22 and can even run in lower versions until 17.
I suggest you to take a look to this documentation ver carefully.
android:targetSdkVersion
An integer designating the API Level that the application targets. If
not set, the default value equals that given to minSdkVersion. This
attribute informs the system that you have tested against the target
version and the system should not enable any compatibility behaviors
to maintain your app's forward-compatibility with the target version.
The application is still able to run on older versions (down to
minSdkVersion).
As Android evolves with each new version, some behaviors and even
appearances might change. However, if the API level of the platform is
higher than the version declared by your app's targetSdkVersion, the
system may enable compatibility behaviors to ensure that your app
continues to work the way you expect. You can disable such
compatibility behaviors by specifying targetSdkVersion to match the
API level of the platform on which it's running. For example, setting
this value to "11" or higher allows the system to apply a new default
theme (Holo) to your app when running on Android 3.0 or higher and
also disables screen compatibility mode when running on larger screens
(because support for API level 11 implicitly supports larger screens).
There are many compatibility behaviors that the system may enable
based on the value you set for this attribute. Several of these
behaviors are described by the corresponding platform versions in the
Build.VERSION_CODES reference.
To maintain your application along with each Android release, you
should increase the value of this attribute to match the latest API
level, then thoroughly test your application on the corresponding
platform version.

NO. You'll not be able to update your app by changing target SDK from
23 to 22.
PROBLEM
Users that have the APK with version code 6, which targets SDK 23 or higher, will receive an error when they attempt to upgrade to this APK because it targets SDK 22.
Now, as you all know, when we keep target SDK to <23, while installing the app by default all the permissions are granted for the app and if we keep target SDK 23 or higher, all the permissions are set to OFF while installing the app.
RESOLUTION
Ensure that your release including APKs targeting SDK 23 or higher to which all users that have the APK with version code 6 can upgrade.

If you didn't change the code(except the gradle file) and the app still works on the '23' version emulator then there shouldn't be any problem.
It really depends on which features(classes and methods) you used in your code.
If you didn't use any of Android 6's features in your code, then there shouldn't be any problem downgrading the target sdk version without having any change for android 6 users.

Related

SDK Version Specifications in Eclipse

I am an experienced Android developer using Eclipse, but one thing still mystifies me. Namely SDK version specifications. In particular, I find several places where SDK versions are specified:
Project Properties: Android: Project Build Target
Manifest: minSdkVersion
Manifest: targetSdkVersion
Manifest: maxSdkVersion
Below are my guesses about usage (probably wrong):
Project Properties: Project Build Type
Ok, seems fairly straightforward. I believe this specifies the API "library" to use.
Manifest: minSdkVersion
My guess is that this is the minimum level (as specified above) for checking methods used. Ok, but seems redundant. Wouldn't the compiler just bark at me if I used an unsupported method?
Manifest: targetSdkVersion
Can't figure this one out. If I call only supported methods, what additionally does this setting do?
Manifest: maxSdkVersion
Even more mysterious. Why would you ever want to limit the max version? Aren't they backward compatible?
The official doc is rather sparse on the functionality of these settings. Can anybody give me some insight?
Android: Project Build Target
When you select a project build target version it means you are apk or classes will be compiled according to selected SDK. for ex - if you select project build target 16 and try to use annotation #JavaScriptInterface it will not find because this annotation is available in above that target.
Manifest: minSdkVersion
If you define minimum SDK version, an Android users who are using below the specified minimum SDK version can't use your app.
For more info from google Docs:
An integer designating the minimum API Level required for the
application to run. The Android system will prevent the user from
installing the application if the system's API Level is lower than the
value specified in this attribute. You should always declare this
attribute.
Manifest: targetSdkVersion
The targetSdkVersion has nothing to do with how your app is compiled or what APIs you can utilize. The targetSdkVersion is supposed to indicate that you have tested your app on (presumably up to and including) the version you specify. This is more like a certification or sign off you are giving the Android OS as a hint to how it should handle your app in terms of OS features.
For example, as the documentation states:
For example, setting this value to "11" or higher allows the system to
apply a new default theme (Holo) to your app when running on Android
3.0 or higher...
The Android OS, at runtime, may change how your app is stylized or otherwise executed in the context of the OS based on this value. There are a few other known examples that are influenced by this value and that list is likely to only increase over time.
For all practical purposes, most apps are going to want to set targetSdkVersion to the latest released version of the API. This will ensure your app looks as good as possible on the most recent Android devices. If you do not specify the targetSdkVersion, it defaults to the minSdkVersion.
Manifest: maxSdkVersion
If you define maxSdkVersion users who are using an android phone running SDK version more than what you defined in maxSdkVersion can't use your app.
For more info from google Docs:
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, sometime 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.
Project Properties: Project Build Type - Yes this will pick up the android.jar and also the build tools version.
Manifest: minSdkVersion - This is not just for the compilation purpose but also used by google play to filter the application.
Secondly, if you have any functionality which is not available below a certain version but required by your application.
Manifest: targetSdkVersion - As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).
Manifest: maxSdkVersion - not recommended. This will restrict your app onto any version higher that the specified maxSdkVersion.
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.
However, future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation
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.
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html covers it all

Android: If I choose minSdkVersion=4 and targetSdkVersion="19" then in which sdk version my android app will be developed?

If I choose minSdkVersion=4 and targetSdkVersion="19" then in which sdk version my android app will be developed?
As if my application is supporting minSDK version=4 then how come it will have feature of SdkVersion=19?
So I'm confused about on which version of sdk my android application will be made if I choose minSdkVersion=4 and targetSdkVersion="19", if it supports all the features starting from version 4 to 19, then how it's doing as in version 4 we don't have features of version 9.
Thanks.
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
contained in:
<manifest>
description:
Lets you express an application's compatibility with one or more versions of the Android platform, by means of an API Level integer. The API Level expressed by an application will be compared to the API Level of a given Android system, which may vary among different Android devices.
Despite its name, this element is used to specify the API Level, not the version number of the SDK (software development kit) or Android platform. The API Level is always a single integer. You cannot derive the API Level from its associated Android version number (for example, it is not the same as the major version or the sum of the major and minor versions).
Also read the document about Versioning Your Applications.
attributes:
android:minSdkVersion
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.
Caution: If you do not declare this attribute, the system assumes a default value of "1", which indicates that your application is compatible with all versions of Android. If your application is not compatible with all versions (for instance, it uses APIs introduced in API Level 3) and you have not declared the proper minSdkVersion, then when installed on a system with an API Level less than 3, the application will crash during runtime when attempting to access the unavailable APIs. For this reason, be certain to declare the appropriate API Level in the minSdkVersion attribute.
android:targetSdkVersion
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion.
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).
As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).
There are many compatibility behaviors that the system may enable based on the value you set for this attribute. Several of these behaviors are described by the corresponding platform versions in the Build.VERSION_CODES reference.
To maintain your application along with each Android release, you should increase the value of this attribute to match the latest API level, then thoroughly test your application on the corresponding platform version.
Introduced in: API Level 4
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.
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.
Firstly, you need to know what these mean.
minSdkVersion signifies the minimum SDK version (which in turn, refers to the version of Android) that your app needs to support it.
targetSdkVersion signifies the optimal SDK version (the version of Android you actually meant the app for) that your app runs on.
However, there's a third setting you missed out on.
compileSdkVersion is the thing that you are looking for. When you set compileSdkVersion to a value (that's between the minSdkVersion and targetSdkVersion) that points to a valid SDK, your app will compile with that SDK as the preferred SDK.
Check out any project's sample build.gradle file to understand how this works. I've linked one below:
https://github.com/googlesamples/android-UniversalMusicPlayer/blob/master/mobile/build.gradle

Can I run my app on API 23 if target SDK version I used is 21

I have developed an Android App having API 21 as target SDK version.
Will it run fine on API above it, for example, API 23?
It is perfectly ok to use a targetSdkVersion and install it on a device that has a greater SDK version.
The targetSdkVersion that you specified in your build.gradle tells the system that you have developed and tested your app to work on that SDK.
If the user installs your app on a greater SDK it is the system responsibility to provide backwards compatibility (if anything has changed).
A good example is what happened with the permissions on SDK 23. Since that version it is necessary to explicitly request for dangerous permissions in code, just declaring the permission in the manifest is no longer sufficient.
However, if you target this app to SDK22, it is not required to request explicitly by code, and if you install this app on a greater SDK system, it will work, because of the backward compatibility, which in this case is to accept all the permissions at install time.
According to Uses SDK
android:targetSdkVersion
An integer designating the API Level that the
application targets. If not set, the default value equals that given
to minSdkVersion. This attribute informs the system that you have
tested against the target version and the system should not enable any
compatibility behaviors to maintain your app's forward-compatibility
with the target version. The application is still able to run on older
versions (down to minSdkVersion).
It could also help you to know this
android:minSdkVersion
An integer designating the minimum API Level required for the
application to run. The Android system will prevent the user from
installing the application if the system's API Level is lower than the
value specified in this attribute. You should always declare this
attribute.
Your minSdkVersion is certainly below the API 21. So, your application does work on above SDK versions (including the API 23).
You're good with that, no worries :)
PS: Check this link targetSDKVersion to learn more about target SDK use purpose.

Will my application be visible to devices higher than my targetSdkVersion in Google Play Store?

I have gone through the following links but they don't provide a clear and definitive answer to my question. This is what I could derive from the answers:
targetSdkVersion indicates that the app is tested against the target version and will run on all android versions from minSdkVersion to targetSdkVersion
with no compatibility issues.
Android Min SDK Version vs. Target SDK Version
what is the difference between "min sdk , target sdk and compile with " ? in android
My app's minSdkVersion=11 and targetSdkVersion=19, Now I am not sure whether devices with higher SDK versions will see my app on Google Play Store or not.
UPDATE: For those who may encounter this question here is a great article I found:
http://www.thedroidsonroids.com/blog/android/compile-min-max-and-target-sdk-versions/
As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).
Android Developer, So the answer is yes, but you might want to consider testing and updating to current SDK version.
Yes, devices with higher SDK versions will see your app. Features of newer SDKs like granular permissions in Android 6.0 will not be available if they are not supported in your code.
The documentation for android:maxSdkVersion makes the situation clearer:
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.
It works on SDK 11 and upwards, as in your first Link stated.
Yes. Your app will be visible to the devices with higher sdk versions than your targetSdkVersion.
By specifying targetSdkVersion you can restrict google by applying default compatibility behaviours.So that you will get along with the api level of the device in which your app is running.
Yes, newer devices will see it. Let's do a thought experiment. Let's go back in time one year. We build an app, setting the minSDKVersion and targetSdkVersion to X, the highest available number in the toolset. Six months ago, X+1 got released. And today I just bought a new phone that runs X+1, and I'm very excited! Wait, what? That brand new app isn't in the store? But it worked on my old phone!
That would be crazy. :)
As a more concrete example, here's an app that has minSdkVersion 15
targetSdkVersion 17: https://play.google.com/store/apps/details?id=com.nasarallysport.rallyracetimer I just verified that I can see it in google play with my Nexus 6 on api 23.

Difference between minimum sdk target sdk and android build project [duplicate]

This question already has answers here:
Android Min SDK Version vs. Target SDK Version
(9 answers)
Closed 8 years ago.
I'm confused about I want to run my app all version of mobile from 2.2 to 4.4. The problem is I'm confused what values I set in minimum sdk target sdk and android project build target can anyone help me what is difference between all three can any one help me thank you.
<uses-sdk
android:minSdkVersion="9"
android target sdk 15
/>
What is difference between minimum target and project build
Read by Your self . Developer.google.com
android:minSdkVersion
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.
android:targetSdkVersion
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion.
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).
As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).
There are many compatibility behaviors that the system may enable based on the value you set for this attribute. Several of these behaviors are described by the corresponding platform versions in the Build.VERSION_CODES reference.
To maintain your application along with each Android release, you should increase the value of this attribute to match the latest API level, then thoroughly test your application on the corresponding platform version.
Introduced in: API Level 4
android:minSdkVersion the minimum version of android that can support the application
android target sdk : the android version that you use to build your project
android:minSdkVersion means the min sdk android version on which your app allow to run
ans android target sdk means the max sdk android version on which your app allow to run
but i insist you don't take max or target sdk because if u launch your app and after any version of android coming then your app will have prob with that sdk

Categories

Resources