This is the first post on Android Application Programming and is hence aimed at walking you through setting up the Android Software Development Kit (sdk) and Eclipse IDE (Integrated Development Environment) in your computer.
Contrary to what you might think or how difficult it might seem at the beginning, setting up Android in your system is very easy. You can also find brief descriptions of the steps to setup Android on http://developer.android.com/index.html. So why do you need this post? Because this post compiles all the instructions so it is easier to choose from available options unlike the android developer official website which provides instructions across a number of webpages based on the type of installation you choose to have and might seem a little confusing to absolute beginners.
Now you can do one of the two things below:-
- If you do not have an IDE already installed in you system or you do but would rather not use it for development purposes, you can download the ADT (Android Developer Tools) Bundle. There are links to download ADT Bundle for various platforms i.e. Windows, Mac OS X and Linux. Choose the one that you require.
- If you choose to use an already installed IDE for development purposes, you can download SDK tools only. These are again present for different platforms.
To save yourself from any complications and unnecessary hard work, I would suggest the first option. The simple reason behind this is that the downloaded IDE is already configured with the ADT Plugin and the SDK is ready. Also it is always advisable to use Eclipse IDE for development purposes which you may not have.
SETTING UP ANDROID DEVELOPMENT TOOLS (ADT) BUNDLE :
If you have downloaded the ADT Bundle you need to do a couple of things.
- Unzip the downloaded file using any compression/decompression software like winzip/winrar to a comfortable location.
- The extracted folder will contain two sub folders namely eclipse and sdk. Get into the eclipse folder and launch Eclipse.
Remember that you should not try and relocate any files or folders because the path of the sdk is already setup in the Eclipse preferences and moving it will cause unwanted behavior.
SETTING UP ANDROID SDK TOOLS TO WORK WITH AN EXISTING IDE :
If you choose to use an existing IDE and download Android SDK Tools instead of the ADT Bundle, you need to work a little more.
- Install the SDK Tools. Remember that this is not the entire SDK environment but a tool that is used to download SDK packages for different versions of android. Since you will be required to refer to the SDK directory from within Eclipse in later steps it is advisable you choose a comfortable location and remember it.
- Do not start Android SDK Manager if you intend to use Eclipse IDE. We have to install the ADT plugin first.
- Launch Eclipse. Navigate to Help -> Install New Software
- Click Add on the top right corner. This opens up a dialog box that requires a “Name” and “Location” for the software to be installed. The location can be the absolute address of an archive in your system, but for the time being we will concentrate on how to download this from the Internet.
- Type ADT Plugin for the name and enter the following URL for the location :- https://dl-ssl.google.com/android/eclipse
- You can use http instead of https if you have trouble acquiring the plugin.
- The next dialog shows you the available softwares that you need to download. Check the Developer Tools. Hit Next.
- All you need to do in further windows is hit Next/OK/Finish. Don’t worry about any warnings saying that the authenticity of the software cannot be established. Anything from Google is bound to be authentic.
- Restart Eclipse IDE once the installation is done.
- When Eclipse IDE restarts you will see a “Welcome to Android Development” window. Select Use Existing SDKs. Browse and select the location of the SDK directory which you installed. Hit Next.
- If for some reason you are facing problem doing this or the the “Welcome to Android Development” window does not pop up you can always set up the path for Android SDK after Eclipse IDE has started up, by navigating to Window -> Preferences -> Android.
- Now you need to download the platform tools and one of the android platforms. Why? Because each android platform has a different set of SDK and hence you need to have the one for which you will be developing applications.
- Launch the SDK Manager from the installed directory or from Eclipse by clicking Window -> Android SDK Manager. It shows all the SDK packages available for you to download.
- As a minimum configuration it is advisable to download the latest tools packages (by checking the Tools folder), the latest version of Android (by checking the first Android folder) and the Android Support Library (by checking Extras -> Android Support Library)
- The Android version in the above step can practically be any Android version but it is always recommended to download the latest.
- If you have the time and resources I would advise you to download the API (Application Programming Interface) for all versions of Android.
All Done!! You are ready to create your first Android Application.
Note :- When Eclipse is launched for the first time it asks for a Workspace directory. A workspace is a directory where all your applications and support files will be stored. Browse and choose a comfortable location for your workspace and check/uncheck Use this as the default and do not ask again according to your needs. I would advise checking it so you do not have to browse through at every launch.