SDK level problems in developer console - android

so im working on a small utility app to get started on the play store and ive come across a few issues which has led me up to this
It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below). This occurs in the change from version 1 (target SDK 23) to version 2 (target SDK 19).
for a small app like this it would be irritating for it to only be available on newer versions considering it doesnt require much. I cant remove the apk nor can i delete the project entirely so the question is should i just publish it for sdk 23 or should i just leave the project alone and make an entirely new one?

You are mistaken. Target SDK means the latest supported version. But it would still allow applications be installed on newer versions. Min SDK version means the earliest supported version.
If Target SDK is set to 23, and update comes out, which is 24, then app would still work on that device, however, whatever new features SDK 24 brings, won't be available.
You can read more at API Guides

Related

Instant App, What's the actual minimum sdk

As per the android developers site, minimum sdk for Instant app is 21, ie 5.0.
link
The site clearly states : Android Instant Apps are available on the majority of devices running Android 5.0 (API level 21) and higher.
But when we create a new project as per the guideline given in this link
which states that we need to have minimum sdk of 23, to get instant app support.
And does not allow me to create a support for 5.0.
as shown in below image which I tried :
That requirement exists only in the setup wizard, and it is a bug. If you change the value to something lower after creating the project, you'll see that it builds fine and can run on API 21 and 22 devices.
The documentation is correct about supported Android versions, but note that even that doesn't dictate any particular minSdkVersion. You can build an instant app with a minSdkVersion lower than 21. It just won't run on anything before 21, since the Instant Apps Runtime itself is restricted to 21+.
For that reason, this check was always a bug, even when we didn't support devices before 23. I was told it was fixed in 3.0, though I didn't verify. I checked tonight and confirmed that the check is still present in 3.0. Could be fixed in a more recent version. But if not, we need to fix that. I'll follow up.
That requirement might be due to android run-time permission support Requesting Permissions at Run Time as official document mention
Note: Beginning with Android 6.0 (API level 23), users can revoke permissions from any app at any time, even if the app targets a lower API level. You should test your app to verify that it behaves properly when it's missing a needed permission, regardless of what API level your app targets.
Currently it has been fixed with android studio 3.1 Canary 5
For instance app minimum API 23: Android 6.0 (Marshmallow).
Please follow this link https://developer.android.com/topic/instant-apps/getting-started/first-instant-app.html

Android SDK takes a huge amount of disk space

I did many searches on the web, and only partially I understood what I have to do.
When my IDE (Android Studio) reminded me that are available recent update for android SDK, I provided to install them. Now I notice that the Android-SDK directory occupies 87Gb of HDD memory.
This because are installed all the Android API from older version to the latest new.
Today I decided to delete all the SDK directory and perform a clean installaton of the SDK tool.
What I ask is which are the minimum things that I've to install from the SDK manager to be up and running for Android Development.
Consider that my apps must run from Android API 14 (4.0 IceCream) to the least available API version (currently on October 2017 is API 25).
In addiction I use an Android Emulator with Lollipop 5.1 (API 22).
The last thing I ask is when there is a new available and I would to install it, should I unistall all the older API version to prevent SDK grow up?
This is the screenshot of my Android Studio SKD manager.
As you can see the only checked API is 7.1.1 Nougat API 25.
This is a series of screenshot of package details of SDK Manager
The others are all unchecked.
I have to say that for Android 5.1 Lollipop API 22, check marks appear after I create the Android Emulator with Lollipop Installed.
NB: I need only things for mobile programming, not TV or Wearable.
should I unistall all the older API version to prevent SDK grow up?
Yes you can do this to reduce the space size taken by the SDK
Cons : you will not be able to use instant run if you are running your app on particular device on lollipop and above.
Note : you can drop old version under API 14 as support library has also dropped the support for older version
From docs, Revision 26.0.0 Release (July 2017)
The minimum SDK version has been increased to 14. As a result, many
APIs that existed only for compatibility with pre-14 API levels have
been deprecated. Clients of these APIs should migrate to their
framework equivalents as noted in the reference page for each
deprecated API.

Can I only install the newest Android API to target lower API Version?

Say I wanna make an app with :
android:minSdkVersion="8"
android:targetSdkVersion="22"
My questions :
Do I need to install both "min SDK Version" as well as the target SDK version?
How if I only have SDK Version of 23 only? Can I make such setting? Or do I need to have both 22 as well as 8?
Can I debug such app with API / SDK Ver 21 phone?
Is it enough to only have the latest SDK version to develop any kind of app?
It is okay if there's any source (link) to comprehensive rule about such ruling, since I didn't found it even after extensive searching.
P.S. I don't know if this info is needed, but the app I wanna make is a libgdx game app.
Thanks
No. (the other answer is wrong)
You only need to have the version that you building with (compileSdkVersion in build.gradle). If you only have 23, then build with 23.
Usually, you should target the same version you build with. However, libgdx is not always fully tested with the latest Android. Check here under Android build version to see what it has been tested for. This is the SDK level you should should target if you want to be sure not to have any problems. Right now, it is version 20 of Android.
I have been targeting Android 22 without issue (that I know of), though. I haven't yet released something higher than 20 yet so no guarantees that it's perfectly safe.
Yes.
Yes. Generally, the target SDK version and the build SDK version should match, but it works if you target a lower version than you're building with.
Targeting a later API basically changes some default behavior of apps. Theoretically, you should be testing on devices spanning the full range of API levels that you support, but in practice this is unnecessary for a libgdx game. But if you target a version that's too old, you might miss out on some newer features. For example, if you target <19, immersive mode (which is desirable for most games) cannot be supported.
Yes you need to install
If you have SDK Version of 23 only but you want to build it in version 22 then also you need to install vesrsion 22 SDK.
Yes you can easily debug such app with API / SDK Ver 21 phone.
I think its enough.

What should be the Target SDK when publishing an Android app?

I have been working on an Android project from past one year in Eclipse with API level set to 4.2 (target SDK 17).
Now I want to publish it in the Play Store. Should I change the target SDK (manifest file) to the latest (i.e. 4.4) since my app works perfectly on KitKat?
The purpose of targetSdkVersion is explained in the developer documentation for <uses-sdk>:
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.
TL;DR: You should set targetSdkVersion to the API level that you've primarily been developing and testing on. Google recommends that you see to it that this is the latest Android version, but that may not always be feasible (for financial and other reasons).
See your app will work fine with kitkat because the newer versions are always made to be compatible with the older android versions,but vice versa is not true....if you develop something in higher API level and then try to run it in older versions of android, than it may happen that your app may not work or some features may not work as expected.So,you too can add KITKAT compatibility in your android manifest file ...cheers
As per this announcement you have to make sure to use a recent target SDK (at most one or two versions older than the most recent), otherwise you cannot publish your app in the Play Store. This is enforced for new apps as of August 2018 and November 2018 for updating existing apps, requiring you to target API level 26 or newer.

Android Target SDK vs Build SDK

In what scenarios would the Target SDK version and Build SDK version ("Compile with" in screen below) differ?
I'm trying to figure out why Target SDK wouldn't be used for both providing the API level the application is designed to run on, as well as compiling against the same SDK.
In what scenarios would the Target SDK version and Build SDK version ("Compile with" in screen below) differ?
When the developer sets them to be different values.
I'm trying to figure out why Target SDK wouldn't be used for both providing the API level the application is designed to run on, as well as compiling against the same SDK.
At the point in time when you create a new project, setting the build SDK and the target SDK to be the same is reasonably common, which is why that's the default in the new-project wizards.
However, developers may well want to raise the build SDK to a newer API level, while leaving the target SDK alone. The target SDK version controls some elements of forwards compatibility and therefore may change things that the developer is not ready to address just yet.
For example, suppose a developer created an app in mid-2013, and at that time set both the build SDK and the target SDK to be 18. Then, early this year, the developer started poking around with Android 4.4 (API Level 19). The developer wanted to add printing capability to her app. The simplest way to support API Level 19 printing is to set the build SDK to 19, so she could reference the relevant classes directly. However, KitKat also changed the behavior of classic AlarmManager methods like set() and setRepeating(), and she decides that she's not ready to deal with that just yet. Since those changes are tied to the target SDK version, she leaves her target SDK version on 18 for the time being, making a note to work on supporting the new inexact nature of AlarmManager alarms in the future. Hence, at this point, her build SDK is 19 and her target SDK is 18.
Target SDK: Highest API level that the application have been tested. The application should be compatible with all the devices with this API level or more recent API.
Compile with: API level with the application have been compiled. For default it's the highest possible level (now it should be Android 4.4.4 kit kat)

Categories

Resources