What versions of the Android SDK should I have installed at least?

Asked

Viewed 2,002 times

5

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

My doubts are:

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

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

2 answers

6

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

The versions you need on your machine are:

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

  • The versions you want to create emulators for. If you want to test the application on an Android 3 emulator, you have to download of API 11.

I want to run on android version 5.1.1. 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, depends on what you were informed on build.Gradle in defaultConfig(equivalent to tag <uses-sdk> in the Androidmanifest.xml).

She has three attributes:

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

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

Its meaning is as follows:

  • android:minSdkVersion="integer" - Indicates the minimum API level required for the application to run. Android will not let the application be installed 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. Informs the system that the application has been tested to run at this level and the system should not provide any kind of "compatibility behavior" to run on devices with the same API level.

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

    Heed: The declaration of this attribute is not recommended, new versions of the API are designed to be compatible with previous versions. There is no reason to intensionalmente block the possibility of the application to be installed in new versions.

  • I’m not sure I quite understand that statement: The latest version. You should always compile the application using the latest version of the API. You should state it in build.Radle in compileSdkVersion version. Is there a reason for this? Or rather, if I don’t use the latest API it won’t work?

  • @Randrade When using the latest version you will be able to use all the features of this version, features that may not exist in previous versions.

  • I understood. It is that when reading that statement I understood something else. But thank you for clarifying. p

3


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

I usually use a small list of packages (the minimum necessary) because I do not rely on emulator to test the code, I test directly on 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 program in Windows you may need Google USB Driver.

If you need an emulator, you don’t need to download all images, just download the ones you have Intel x86 Atom System image or Intel x86 Atom_64 System image (if your computer is 10 years old). Note: it is good to have at least 8 GB of RAM.

A case where the package Android Support Repository it is necessary when your android:minSdkVersion differs from the android:targetSdkVersion.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.