Android has officially become the world’s most popular mobile platform, so it should be a tremendous motivation for people who would like to get involved in developing software apps that could potentially run on millions of devices. We will start a series of fundamental tutorials that basically assume you are a complete novice to the Android software development environment and provide the essential knowledge for you to become an Android developer, i.e. starting to write Android apps and publish your work for distribution. This beginning article will be mainly focused on where to find and download the development tools, what they are, how to set them up, and how to make sure they are up to date in the future.
Official Resources for Android Development
Everything about Android is encapsulated at the Google’s Android portal site http://www.android.com. It is comprised of several general introductory resources about what Android is, what devices are running it, what features it offers, variations among different versions, and market places.
As developers, our starting point is at http://developer.android.com. Just in case this subdomain no longer exists, you can always go back to the above Android portal site and locate the developer section. This site collects all the info for developers to design, develop and distribute your apps. Before actually doing anything in Android, we need to get the tools installed and ready.
Downloading the Android SDK and Developer Tools (ADT)
Before you start installing Android-specific tools, making the Java compiler available in advance is suggested. This way, when the Android IDE starts up, it can potentially establish a Java connection automatically. Usually, most machines have Java JRE installed but JRE (Java Runtime Environment) is only for running Java, not for code compilation, so you will need to have the Java SDK. If you do not have the Java SDK installed, locate your system type and download it from http://java.com/en/download/manual.jsp.
All Android setups are silimar on Windows, Linux, and iOS. We only illustrate the process through Windows installation. You have three options to prepare all the necessary downloads for Android development.
- ADT Bundle:This bundle includes the popular IDE, Eclipse, Android SDK, ADT plugin, platform tools, and system images for emulators .
- Android Studio:This is still in “early access preview” release mode, so some functionalities are not yet complete. It is based on IntelliJ IDEA. To me, the main advantages over the above bundle are its rich layout editor allowing you to drag-and-drop user interface (UI) components and Lint tools .
- Exisiting Eclipse IDE: This is if you already have exisiting Eclipse and prefer setting the Android SDK and ADT plugin by yourself. I’ve done it in the past and it requires some knowledge to put all the pieces together.
What I would highly recommend at the moment is the ADT Bundle option. It should save you some trouble for configuring separate downloads. It has 32-bit and 64-bit versions for downloads. If you are not entirely sure, do a right mouse click on your Windows “My Computer” icon and select “Properties” to find out your system type. This ADT Bundle contains several major tools, so please be patient with the currently 500MB download. Again, no matter which option you go with, you still need to have Java SDK available on your machine so that Eclipse knows what compiler to use and run your Android apps.
Setting Up Development Tools
After downloading the ADT Bundle, uncompress the zipped file and choose the folder name “adt-bundle” you should see an eclipse folder, sdk folder, and SDK Manager.exe file as in Figure 1.
Figure 1: ADT Bundle Folder
The following lists some important info on files you will want to be able to locate in the future:
- Android ADT: It can be located under eclipse/pluginsfolder.
- SDK Tools: All the emulators, debugging and testing tools can be found under sdk/tools.
- SDK Platforms: sdk/platformsinlcudes one SDK platform per Android version.
- SDK Platform-tools: sdk/platform-tools contains platform-dependent tools for developing and debugging your application. adb.exeis one of the most important executables to be used later.
- Samples for SDK: sdk/extras/android/support/samples/ contains many useful sample apps. The most important sample app is API Demos illustrating almost all the major functionalities and UI examples, which you can copy and modify for your own apps.
Now you have the overall folder structure for Android SDK. Please note the ADT Bundle does not contain all the platfoms but only the most recent platform version instead. In some cases, your device might only support a specific Android version. Luckily, it is actually not too difficult to accomplish this through a utility contained in the bundle. You can go ahead and make the tools more complete by starting up the executable SDK Manager.exe for more platforms and tools. Figure 2 shows the dialog allowing you to manage your downloads. For example, if you need to install a specific platform, e.g. Android 4.3 (API 18) or Jelly Bean, you will at least enable the checkboxes for SDK Platform, Samples for SDK, and Google APIs.
Figure 2: Android SDK Manager
More Resources for Downloads
There are optional downloads and other resources you may find useful, especially if you foresee yourself getting into more advanced Android development down the road. Here are some recommendations:
- Android NDK: If your software requires high-performance CPU-intensive operations or needs to integrate with native-code languages such as C and C++, then this is for you. Download NDK from: http://developer.android.com/tools/sdk/ndk/index.html
- Android at Google Code: On many occasions, I could find sample Android projects at Google Code site. You can learn a lot from other developers by studying their code. Check out: https://code.google.com/hosting/search?q=Android
- Android at XDA Developers: This is a very popular site for hackers. Usually, you can find tools to root the devices, collect system info, replace system firmware, etc. Check out: http://forum.xda-developers.com/android
This short tutorial is intended to point you to the key resources to start your Android development. Also, some more advanced resources are recommended. We are ready to move on to actually start writing Android code pretty soon.
If you are comfortable enough, you can jump one step ahead and try to start eclipse/eclipse.exe since by now you should have a rough idea where the main files are. Before you can run Android apps on emulators, you will need to set up a virtual device through Android Virtual Device Manager under the Window menu tab as in Figure 3to be continued in the next tutorial.
Figure 3: Android Virtual Device Manager
- Android Portal at: http://www.android.com
- Google Play Store at: https://play.google.com
- Androidlet at http://www.androidlet.com
About the Author
Chunyen Liu has been a software professional for years. He was among winners at programming contests. He has co-authored software patents, written 25+ articles, reviewed books, and published apps at Androidlet and The J Maker. He holds advanced degrees in Computer Science with 20+ graduate-level courses. On the non-technical side, he is a tournament-ranked table tennis player, certified umpire, and certified coach of USA Table Tennis.