This is the first post in a multi-part series on Android development. Throughout the series, we’ll explore how to build applications for the Android platform. This first post is an introduction to the Android SDK and the Eclipse IDE along with a high-level overview of Android applications.
- Java Development Kit (JDK) – self-explanatory; the Java runtime and development libraries. You can download it from here (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
- Eclipse – an IDE (integrated development environment) for Java and other languages. If you don’t have it installed, You can get the Eclipse Classic 3.7.2 version, which will suit the needs of this tutorial. The Windows download doesn’t contain an installer, so extract the ZIP in an accessible location, such as C:\eclipse. You can download it from here (http://www.eclipse.org/downloads/)
- Android Software Development Kit (SDK) – The heart of Android development. This provides all of the necessary tools and libraries required to build applications for the Android platform. Extract it to an accessible location on your hard drive and run the setup executable, which will download and install a set of components. You can download it from here (http://developer.android.com/sdk/index.html)
- Android Development Tools (ADT) Eclipse Plugin – This plugin adds Android-specific development tools and project templates to Eclipse. Instead of a separate download, it installs within Eclipse as we will describe next
Use the Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer. Assuming that you have a compatible version of the Eclipse IDE installed, as described in the previous step above, follow these steps to download the ADT plugin and install it in your Eclipse environment.
Installing Android Development Tools (ADT) Eclipse Plugin
- Start Eclipse, then select Help > Install New Software….
- Click Add, in the top-right corner.
- In the Add Repository dialog that appears, enter “ADT Plugin” for the Name and the following URL for the Location:
Note: If you have trouble acquiring the plugin, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons).
- Click OK wait for pending
- In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
- In the next window, you’ll see a list of the tools to be downloaded. Click Next.
- Read and accept the license agreements, then click Finish.
- When the installation completes, restart Eclipse.
- After eclipse restarted you will see a window to choose SDK Choose exist Andriod SDK or choose to install it from the beginning
- In my case because we already install the sdk in step 3 i will choose the SDK Installation folder then Next
- Choose weather to Contribute usage statistics or not
- We haven’t finish yet we still have to install SDK’s to be ready for developing our first android application, to install sdk’s first open SDK Manager
- Choose Android SDK platform-tools under Tools Note: Android SDK Tools and Android SDK Platform-tools is important to be installed so make sure that u install it also choose the appropriate API you will work on it from Android API’si will choose Android 3.2 (SDK Platform, Google Api’s by Google inc.) about XOOM 2 by motorolla its optional to install if you going to develop a plugin for that devices
- Choose Google USB Driver package
- Click Install packages, then accept terms and conditions (You can choose Accept all to force accept for all selected components you will install ) that will take a few minutes to complete
- Now we are ready to create our hello world application.
Create HelloWorld application
- Go to File Menu then New then choose other in order to create an Android application
- After that a wizard appears to select application you want to work on search for android or collapse Android in the list of project types appears in the list
- Now its time to add your project name and choose Create new project in workspace to add your code in a newly folder in the workspace
- Select your build target i will choose Android 3.2 which we select to install in the SDK Manager
- After click on next we have to fill in the application info the application name which we already defined in a previous step also the package name as you can see in the next picture i named it “com.helloworld.hello” that is the main package that will be in the application also set our main activity name which is named by default HelloWorldActivity (activity name by default is a combination between application name and and Activity) later in the next tutorials we will discuss deeply what is activity mean but for now you have to know that is the main entry for the application. also you can see Minimum SDK by default it will be loaded to 13 because we choose SDK version 3.2 which is API 13. Minimum SDK is option to define what is the lowest android system your application can run in off course if you choose API 13 then your application can’t run on lowest android systems.
- After click on finish eclipse will create a new application named HelloWorld for us and some building process and here is our hello world application ready
- We are not ready yet to lunch our application we have to add AVD(Android Virtual Device or emulator) AVD helps us to run our android project in a similer environment as like it is in the device exactly. so to do so we have to click on AVD Manager icon on top beside SDK Manager to open AVD Manager
- Click on New in the upper right of the window to create a new AVD you have to fill in android name and the desired Target of build for the emulator as example if we choose Android 3.2 – API Level 13 as explained in the following picture the emulator will be running that operating system then you have to specify SD Card lets say its 200 MG the other options is preferred to be the default then click Create AVD
- Now we are ready to running our HelloWorld Application so go to run
- Then choose android Application from Run As window.
- Wait for the emulator to lunch that will take a few minutes in the first time then your application is ready now with that screen
That all for that tutorial we can now run an android application and ready to begin development, In the next tutorial we will get deep in the application hierarchy and discuss the folders and the code.