Set up your Android development environment
Before you can create Android applications, you must install the Android SDK. Installing the Android SDK also installs AVD Manager, a graphical user interface for creating and managing Android virtual devices (AVDs).
On the Android website, download the correct version of the Android SDK for your operating system.
Unzip the archive to your chosen location. For example, on Linux or Mac, you can put it at the root of your user directory. For more installation information, see the Android Developers website.
Set the ANDROID_HOME environment variable based on the location of the Android SDK. Also, consider adding ANDROID_HOME / tools and ANDROID_HOME / platform tools to your PATH.
Windows set ANDROID_HOME = C: \\ android-sdk-windows set PATH =% PATH%;% ANDROID_HOME% \ tools;% ANDROID_HOME% \ platform-tools
To run the code in this guide, you need to download and install the latest SDK platform. You do this using the Android SDK and AVD Manager, which you installed in the previous section.
Open the Android SDK Manager window
Check the "Tools" box.
Check the box for the latest version of the Android SDK.
In the Advanced folder, select the checkbox in the Android Support Library.
Click the "Install packages ..." button to complete the download and installation.
If you do not have an Android device to test, you can use an Android virtual device. To do this, you must first install the Android SDK and install the appropriate platforms and SDKs. See Set up your Android development environment.
This command creates a new AVD called "Default", based on Android 5.1, API level 22:
android create avd --name Default --target android-22 --abi armeabi-v7a
source share