Download and setup Android Environment

Android Studio which provides everything you need to start developing apps, including the Android SDK tools and the Android Studio IDE (powered by IntelliJ) to streamline your Android app development.
But, before you set up Android Studio, be sure you have installed JDK 6 or greater (the JRE alone is not sufficient).
  • JDK – Let’s download the latest JDK available from the following link and then install:
Note: Make sure that you download the appropriate version (i.e. for 32-bit or 64-bit) for your system.
  • Android Studio – Download the latest version of Android Studio from the following link:
To set up Android Studio on Windows:
1. Let's launch the downloaded EXE file, android-studio-bundle-<version>.exe and click Next button
2. Keep the default selection and click on Next button:
3. Let's keep the default Destination Folder path and click Next button:
4. Click Install button:
5. Installation will start as shown below:
6. Once the installation is completed, it will show the message > click Next button:
7. Click Finish button to complete the installation:
It will start Android Studio!
Note: After installation when you try to open Android Studio, the launcher script may not find where Java is installed and a popup is shown as follows:
If you encounter this problem, you need to set an environment variable indicating the correct location (JDK).
Open System Properties from Control Panel > click System (or press +) > click Advanced System Settings > open Advanced tab:
Click Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.8.0_11
Android Studio is now ready and loaded with the Android developer tools, but there are still a couple packages you should add to make your Android SDK complete.

Adding SDK Packages

You have to download some packages using the Android SDK Manager before you can start developing.
  • Open Android Studio > click Configure option on Quick Start menu > click SDK Manager
  • You will see some of the packages are already selected. Let's keep them selected and select some other required Tools and Packages as shown below:
    • Android SDK Tools
    • Android SDK Platform-tools
    • Android SDK Build-tools (highest version available)
    • SDK Platform (under the latest Android x.x folder)
    • A system image for the emulator, such as ARM EABI v7a System Image
  • Click Install packages button to start installation of the selected tools and packages. 
It'll show a popup once installations are completed:
Now you're done setting up Android Studio and ready to build your first Android app!
Note: Make sure you download latest packages from SDK Manager when new tools/API would be available.

Creating Android Virtual Device (emulator)

Before we jump into developing Android application, first we've to create a virtual device (an emulator) where the application can run. Otherwise we can also run the apps on a real device.
In this article, we'll discuss how one can create an Android Vertual Device.
1. Let's launch AVD Manager by pressing +Q keys > type AVD Manager in App search > select AVD Manager from the searched result and press Enter key to open AVD Manager > click Create button
2. Fill in the details for the AVD: Give it a name, select a Device, a platform target, and a skin (HVGA is default) >
Click OK.

Note: You may find that the OK button is disabled. In case there is no system image is installed for the selected target, the OK button remains disabled. So, make sure that you select a Target for which system image (i.e. ARM EABI v7a System Image) is already installed. Otherwise you have to install the required system image fromAndroid SDK Manager.
3. Select the new AVD from the Android Virtual Device Manager and click Start button
4. This might take few minutes to boot up the emulator. Once it's ready just unlock the emulator screen.
Bingo!!! our mission is acomplished! Smile | :)

Creating AVD from Device Definitions

In the above section, we saw how to create an Android Virtual Device by providing all the required details manually. There is another option available through which one can create an AVD quite easily.
1. Let's launch AVD Manager > click Device Definitions tab which will show a list of all known device definitions > select one device and click Create AVD button:
2. Create new Android Virtual Device window will be opened with prepopulated values from the selected Device Definition > click OK button
3. It will create the AVD and show a popup message as shown below:

No comments:

Post a Comment