Which Android SDK versions should I install at a minimum?

5

When I downloaded Android Studio and opened the SDK Manager it shows some packages to be downloaded and installed. I saw that it has several versions of Android.

My questions are:

  • Which of these are "extremely" indispensable so that I can build Android App on my machine?

  • For example: I want to run on the android version 5.1.1. Do I really need to download the more than 10GB of the entire 5.1.1 package?

asked by anonymous 03.09.2016 / 12:42

2 answers

3

I also had this doubt when I started programming for Android.

I usually use a small list of packages (the minimum required) because I do not depend on the emulator to test the code, I test it directly on the Smartphone.

Minimum list:

Tools:

  • Android SDK Tools
  • Android SDK Platform-tools
  • Android SDK Build-tools

Android N.N (API NN)

  • SDK Platform

Extras

  • Android Support Repository
  • Google Repository

Replace NN with the API level that is your target android: targetSdkVersion (22 is for Android 5.1).

If you're programming in Windows you may need the USB Driver .

If you need an emulator, you do not need to download all images, just download the ones that have Intel x86 Atom System or Intel x86 Atom_64 System image is 10 years old here). Note: It is good to have at least 8 GB of RAM.

One case where the Android Support Repository package is needed is when your android: minSdkVersion differs from android: targetSdkVersion .

>     
04.09.2016 / 18:57
6
  

Which of these are "extremely" indispensable so that I can build Android App on my machine.

The versions that you must have on your machine are:

  • The latest version. You should always compile the application using the latest version of the API. So you can use all the features of the SDK, including new ones that do not exist in previous versions. You must enter it in build.gradle in compileSdkVersion version .

  • The versions for which you want to create emulators. If you want to test the app on an Android 3 emulator, you need to do the download API 11.

  

I want to run on android 5.1.1. Do I really need to download the more than 10GB of the entire 5.1.1 package?

  • No, as long as you follow the rule of always using the latest API to compile the application.
  • Yes, if you want to create an emulator with Android 5.1.1 to test the application.

Where your application can run, it depends on what you reported in build.gradle in defaultConfig (equivalent to tag <uses-sdk> in AndroidManifest.xml ).

It has three attributes:

  • android:minSdkVersion="integer"
  • android:targetSdkVersion="integer"
  • android:maxSdkVersion="integer"

These three attributes allow the application to report its compatibility with one or more versions of Android.

Its meaning is as follows:

  • android:minSdkVersion="integer" - Indicates the minimum level of API required for the application to run. Android will not let the app install on devices with an API level lower than the value indicated by this attribute.

  • android:targetSdkVersion="integer" - Indicates the level of the API for which the application was made. It informs the system that the application has been tested to run at that level and the system should not provide any type of "compatibility behavior" to run on devices with equal API level.

  • android:maxSdkVersion="integer" - Indicates the maximum level of the API that the application can run on. Android will not allow the app to be installed on devices with an API level higher than the value indicated in this attribute.

    Warning: Declaring this attribute is not recommended, new versions of the API are designed to be compatible with previous versions. There is no reason to intensively block the possibility of the application being installed in new versions.

03.09.2016 / 15:36