Edumobile: Mobile Training
Edumobile: Mobile Training
.org
Android is the new age operating system for mobile phones from Google
and other Open Handset Alliance members like Intel, TI, T-Mobile, and
NTT DoCoMo. This is the next big thing in the world of Mobile
Telephony and the next few years are going to be huge for the Android
developers with initial estimates of more than hundred million smart
phones will be powered by Android. In this Chapter we will learn how
to install the SDK and the development environment for Android. As per
our the programming tradition we will also create a “Hello World”
program and will try and understand the basics of the Eclipse IDE which
we will be using.
Java 5.0+
We will need java to run Android development environment, we
recommend you use the latest JDK available for download for Android.
Download the JDK from
http://www.java.com/en/download/index.jsp
You can install either the windows or Mac JDK based on your operating
system. Please note that you will need a JDK and not a JRE for Android
development.
Once your JDK is installed you can check the version number from the
console
Eclipse
Eclipse is the all season IDE from IBM. Eclipse is the official IDE for
Android and we will use Eclipse for all our learning here in this course.
Please download Eclipse from
http://www.eclipse.org/downloads/
The minimum supported version of Eclipse is 3.3.1 but you should install
the latest available version. Once you have downloaded you can just
unzip and save it in your development drive. You can double click the
eclipse.exe to run the eclipse.
Android
http://d.android.com/sdk/index.html
Download the SDK as per your operating system. Expand the SDK and
run the SDKsetup.exe. In the window that appears accept all packages
and let is download all the necessary files.
Once it downloads it will install the necessary files and you are ready to
program for Android.
https://dl-ssl.google.com/android/eclipse/
Download the ADK and it will gets added to your eclipse. Once done
you will have to restart the eclipse. If properly installed you will now see
eclipse icon on your Eclipse Window.
We will now create our first Hello World Program. We will just see how
to create the program and for the time being we will not deal in syntax of
the code. We will just ensure that we know how to create a simple
program and execute it and obtain the results in the Emulator.
1. Start your eclipse if not already running and select New Project
from File Menu.
2. Select the Android project and name it “Hello World” and put the
following details
3. Once you do this the SDK creates a new project for you. Select the
Hello.java from the src folder of the “Hello World” and you can see the
code there.
4. We will now run it in the emulator. Select the Hello World Project and
do
As this will be your first application, you will be required to create a new
AVD or Android virtual Device. You will get the following Dialog box.
Press “New” to bring up the following dialog box to create the new
AVD.
Name: EM2
Target: Android 2.05 – API level 5
SDCard: 500
Skin: Default (HVGA)
Select “Create AVD” to create the AVD. If successfully created you will
get the following dialog box
And then when you launch it you will see the Emulator coming up. It
will take some time for the emulator to boot up and start. Once its starts
you will see the following on the screen.
If you see the above in your screen it means you have successfully
created your first program. Congratulations!!
This is your first step and the path ahead can be steep at times but you as
long as you keep moving we can assure you that soon you will be able to
create those cool applications for it. “Best of Luck”
Note: While you are working on Android keep the Simulator on as it will
take lot of time for it to restart again.