-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learning Android Application Development
By :

Before being able to build an Android application, we have to download and install Android Studio on our computer. It is still possible to download and use Eclipse with the Android Development Tools (ADT) plugin, but Google no longer supports it and they recommend that we migrate to Android Studio. In order to be aligned with this, we will only focus on Android Studio in this book. For more information on this, visit http://android-developers.blogspot.com.es/2015/06/an-update-on-eclipse-android-developer.html.
The latest stable version of Android Studio can be found at http://developer.android.com/sdk/index.html.
If you are among the bravest developers, and you are not afraid of bugs, you can always go to the Canary channel and download the latest version. The Canary channel is one of the preview channels available on the Android tools download page (available at http://tools.android.com/download/studio) and contains weekly builds.
The following are other preview channels available at that URL:
The following screenshot illustrates the Android Tools download page:
It is not recommended to use an unstable version for production. To be on the safe side, always use the latest stable version. In this book, we will use the 2.2 preview version. Although it is a beta version at this moment, we will have the main version quite soon.
Android Studio requires JDK 6 or higher: JDK 7 is required as a minimum if you aim to develop for Android 5.0 and higher. You can easily check which version you have installed by running this on your command line:
javac -version
If you don't have any version of the JDK or you have an unsupported version, please install or update your JDK before proceeding to install Android Studio.
Refer to the official documentation for a more comprehensive installation guide and details on all platforms (Windows, Linux, and Mac OSX) at http://developer.android.com/sdk/installing/index.html?pkg=studio.
Once you have JDK installed, unpack the package you have just downloaded from the Internet and proceed with the installation. For example, let's use Mac OSX. If you download the latest stable version, you will get a .dmg
file that can be mounted on your filesystem. Once mounted, a new Finder window will appear and will ask us to drag the Android Studio icon to the Applications
folder. Just doing this simple step will complete the basic installation.
If you have downloaded a preview version, you will have a ZIP file that once unpacked will contain the Android Studio Application directly (it can be just dragged to the Applications
folder using Finder).
For other platforms, refer to the official installation guide provided by Google at the web address mentioned earlier.
Once you have finished installing Android Studio, it is time to run it for the first time. On the first execution (at least if you have downloaded version 2.2), it will let you configure some options and install some SDK components if you choose the custom installation type. Otherwise, both these settings and SDK components can be configured or installed later.
The first option you will be able to choose is the UI theme. We have the default UI theme or the Darcula theme, which basically is a choice of light or dark backgrounds, respectively.
After this step, the next window will show the SDK Components Setup where the installation process will let you choose some components to automatically download and install. On Mac OS, there is a bug in some versions of Android Studio 2.0 that sometimes does not allow selecting any option if the target folder does not exist. If that happens, follow these steps for a quick fix:
/Users/<username>/Library/Android/sdk
, to the clipboard.mkdir /Users/<username>/Library/Android/sdk
.
Change the font size
Change margin width
Change background colour