Monday, June 13, 2011

Setting up android development in eclipse

For setting up eclipse with android – we need eclipse for sure. Smile with tongue out
So we need -
  • Eclipse EE
  • Install Android Development Toolkit or ADT plugin in eclipse
  • Android SDK

Installing Eclipse

Download eclipse from Eclipse IDE for Java EE developer. If you already have eclipse please ignore this.

Download the Android SDK

Download the Android SDK from here and extract at some location you like.

Install ADT plugin in Eclipse

Next, open Eclipse back up, as we will be adding the Android information to Eclipse. In Eclipse, select "Help -> Install New Software" as shown:
eclipseInstallNewSft In the window that pops up, select "Add", and in the windows that pops up, eclipseInstallNewSft2

Enter "Android" for the name, and for the location, use "https://dl-ssl.google.com/android/eclipse/". Hit "OK". If that location does not work, take the "s" off of "https".

The following window will appear.
android-avaliable-updates

Please select all the packages that appear, and hit "Next -> Next", accept the terms, and then click "Finish".
android-avail-update2

This will begin downloading the Android Development Tools. This will go on in the background of Eclipse. Once it's done downloading, it will prompt you to restart Eclipse. Please do so. (If it tells you you are downloading unsigned content, please say that it's okay.)

Configuration

Next, navigate to Window Preferences and select Android. Get the path of the installed folder. addPath2AndroidSdk


Select Window -> Android SDK and AVD Manager from the menu. AVD_sdk_manager
Select the Available Packages on the left and select the Android versions you want. (I usually pick 1.6, 2.1, 2.2, 2.3, and 3.0). "Accept" the terms and click "Install". This will take quite a bit of time to install all of these, so please be patient. android-add-repositories
Press "Install selected" and confirm the license for all package. After the installation restart Eclipse.
That's all we are almost done.

Create the Android Emulator Device

The Android tools include an emulator. This emulator behaves like a real Android device in most cases and allow you to test your application without having a real device. You can emulate one or several devices with different configurations. Each configuration is defined via an "Android Virtual Device" (AVD).
To define an AVD press the device manager button, press "New" and maintain the following.
1emulator button
Select Virtual Drive tab on left and click New. 2new avd button
Name the device and select on which Android you want to work.
3create avd

Press "Create AVD".
This will create the device and display it under the "Virtual devices". To test if your setup is correct, select your device and press "Start". 4start avd
You will get to see AVD launch options - 5avd_launch_options
After (little long time) your device should be started.
6Andoid emulator started

No comments:

Post a Comment

Chitika