Android SDK takes a huge amount of disk space - android

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.

Related

can I build against newer android SDKs without excluding owners of older phones?

so I'm using QT to develop an app for Android, and according to Sophos Mobile Security this app is "Built for outdated Android versions: this app doesn't support recent android security features. the app was built for an older version of android"
in qt creator I have android-25 set as the android build sdk (which I wouldn't consider old after all, it's 7.1.1 nougat)
how can I make this warning go away? Is there a way to build my app for a newer version of android without excluding users from using it? (I have 7.1.1, and at least I want to use my app)
thank you for your response in advance.
EDIT:
seems like there are (at least?) 3 spots where I can set an SDK version:
minimum required sdk, as seen on the screenshot here: Qt for android: change the application icon
target SDK version, as seen on the screenshot above
this was the only one I was aware an hour ago: projects->build->build android apk->android build sdk
what they govern, how to set them? should they be the same or different?
Android suggests you use the latest sdk version for targetSdkVersion and for build-tools version (they have to match). In fact, Google Play now requires you to target at least SDK 26. This will not prevent older devices from running app. Actually it will be more problematic for newer devices, as you are stating that app has been fully tested and can run on newer devices, and does not need backward compatibility. See https://developer.android.com/distribute/best-practices/develop/target-sdk for more details.
As for minSdkVersion, that is what will determine the earliest devices supported, and you should try to keep it as low as you can, and as 95-99% of your users.

Udate Device SDK Android

My phone is running an earlier version of the Android SDK and I would like to update it. Is this possible?
I can easily update the version on my computer with the SDK manager, but if I target the newer version I get the error deviceSDK < minSDK.
Is there a way to update the actual device sdk? I can't seem find any mention of this on the internet. Thanks!
Most likely the Android version that you are running on the phone is an older version than what is specified in the Gradle for Minsdkversion.
Android 4.4.2(Kit Kat) is sdk version 19 where as 6.0.1(Marshmallow) is sdk 23.
The only way is to wait for a manufacture update or to root the device and install a custom ROM that is a newer base version of Android.

SDK level problems in developer console

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

Android -- selecting API from SDK Manager

I have downloaded the Android SDK(which i think has no version, it is standard). After installing Android SDK, Android SDK Manager comes which by default selects 3 things to be downloaded (1)Android SDK tools(2)Android 4.0.3 (API 15) and the things under it like documentation, samples etc (3)Google USB driver But at present i am having book on Android 3, so should i deselect the second option i.e. Android 4.0.3 (API 15) and select all things under Android 3.0 (API 11) or keeping Android 4.0.3 will be OK for Android 3.I know there are tutorials for Android 4.0.3 on Web so why should i go for Android 3 because i find it easy through books and i got Android 3 here in my place and still no Android 4. So what should i do?
You can install everything. I would recommend to install the API level you want to develop for. But it doesn't hurt (but wastes disk space) to install everything.
Sidenote: Android 3.0 is for tablets, 2.x for older and 4.x for the latest Android Smartphone devices.
You should select the API level that you will target. For example, I am writing an application for API level 7 (Android 2.1.x), so I've got that version installed on my machine. Of course, you can have more than one API level installed, so it is safe to install any combination (for example 3.0.x and 4.0.4 simultaneously - see last paragraph for the reason).
Once you've got a few API levels installed, Eclipse will allow you to change the target API for your project to any of the versions you have installed. The same applies for the command-line project creation.
There is actually one good use-case for installing a version newer than the one you are targeting in addition to the one you use: testing. You can create an emulation environment for a newer version of the API to ensure that your application does not crash and burn when the API levels do not match. If we were to extend my above example, a sensible set of levels to install is 3.0.x, 3.2, and 4.0.4. You can target the initial release of Honeycomb (unless you need anything from the later versions), and test with both the latest Honeycomb and Ice Cream Sandwitch.

Android app compability

I've build my app under the version 1.6, 2.1 and 2.2 of android and it works. I'd like to know when I'll publish it what is the best :
Build under 1.6 and so it will be compatible with newer version of android
or
Build under 2.2 and set "Target SDK version" to 8 and "Min SDK Version" to 4
Thanks
If you're not using anything that is specific to 2.1 or 2.2 there is no difference. If you for example use install to SD card feature of 2.2 you have to use Target SDK and min SDK option.
Build it under 2.2 and use Min SDK Version.
Target Version is described as the following:
"With this attribute set, the application says that it is able to run on older versions (down to minSdkVersion), but was explicitly tested to work with the version specified here."
Actual statistics of the "market share" are available on the developer website:
http://developer.android.com/resources/dashboard/platform-versions.html
1.6 takes 20% at the moment.

Categories

Resources