We started with android introduction few days back and plunged into android revolution.
The next step in android development is to jump start by installing the components needed for the development.
This is the guide for installation although the android developers website provide much help for newbie developers,I will try with some screen shots and some solution for common errors during the installation.
Step 1 – Check basic requirements
what will you need ?
Eclipse IDE
Download Eclipse IDE from http://www.eclipse.org/downloads/ , select the java developers package or java EE developer package.You will get an zip file after downloading,Extract it to some location in your local drives.[ Do Extract the package and dont run the application as is in zip file ]
Java Developers Kit(JDK)
Download JDK 5 or 6 from http://java.sun.com/javase/downloads/index.jsp and complete the installation.
Step 2 – Installing Android development tool (ADT) for eclipse IDE
You have to install the ADT plugin to your Eclipse IDE inorder to develop android applications.You cannot directly download this ADT plugin,you can only download through the IDE interface.
Now run the Eclipse application and select Help > Install New Software.
In the Available Software dialog box, click Add
Provide a name for your remote site ex: Android plugin
In the Location field, enter the URL: http://dl-ssl.google.com/android/eclipse/
[I am using http instead of https to avoid the “Failed to fetch” error.]
Now you will see a window like shown below,check the developer tools check box to select DDMS and development tools.click Next
click Next and accept the terms and conditions and click Finish.
Step – 3 Install the android Software development Kit(SDK)
Download the android SDK for windows,Mac and linux and extract to a location and run SDK Setup.exe [ Location of this SDK setup is to be
After some moments android SDK and AVD manager will start and you will be prompted to select the packages you wish to install,select as per your needs but minimum you have to select one platform ex- android 2.2, android 2.1 etc
Then click install selected
wait for the installation to complete.[Here I have selected SDK API,documentation,Platform and samples.
Step 4 – Setting up Android Virtual Device (AVD )
Android virtual device is the emulator that provides the virtual output for our applications.
In Android SDK and AVD Manager go to Virtual devices and select-> New
provide the name of the virtual device and select target to your installed platform.here I have installed android 2.2.If it can’t able to select the target then you didn’t installed any android platform packages.
Leave the other settings as is [ This setting is used for emulator configuration] click create AVD and OK
Step 5 – Configuring Eclipse ADT
Before starting to develop applications,you need to configure eclipse ADT plugin to properly work with SDK.
Open Eclipse IDE and click window then preferences and select Android in the left pane.
Now click browse and select the path where the android SDK is extracted in step 3 click apply and OK.If selected correctly the target name will be displayed in the window.If not selected the target name won’t be displayed.
Step 6 – Starting an android project
The trouble some part is over.Now click file-> New->Project in Eclipse
Select Android->Android project
Select
- Project name: HelloAndroid
- Application name: Hello, Android
- Package name: com.example.helloandroid
- Create Activity: HelloAndroid
click finish.
Now the application is ready,Your Android project is now ready. Open the
1 | HelloAndroid.java |
file, located inside HelloAndroid > src > com.example.helloandroid
Change the code to
package com.example.helloandroid; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(tv); } }
Step 7 – Run your first mobile application
Select run->run->android application
The android emulator will show up.It will take some time for the dive to boot up for first time.
Finally Hello world application is executed on the AVD.
Watch Our Android category for next tutorial.Subscribe to our rss feeds
Share your comments about android installation .
See also :Android 3.0 Honeycomb demo by Google-Full video on new features
Thanks for these steps….I have succesfully ran first program.
If I want to load this program/application to my android phone then what should I do ? I mean which file to load and how ? – I am a beginner so please mention all the steps. Thanks in advance
—
Regards,
Mukesh Lahori
Thanks for the comment Mr Mukesh.
You can load your application into an android phone connected via USB.
Before you do that , you need change some settinga of eclipse as well as on phone.
follow these steps mentioned on this site http://developer.android.com/guide/developing/device.html.
Please reply if you need any further clarification.
If you are running on windows you need to install adb driver for USB.
Download it here.
http://dl.google.com/android/android_usb_windows.zip .
Hi, keep up the awesome work!
Download the “Android Forum App” from the android market..pretty neat
I just book marked your blog on Digg and StumbleUpon.I enjoy reading your commentaries.
hi……we are doing our final year project on android application……please help us if u hv any materials,ideas about any new application for android phones…..we r glad to get u r help….
thank you….
Excellent piece of document for beginners!!
It was helpful for me to start my Andriod app development.Thanks .!! Expecting more tutorials