Tuesday, 23 August 2011

How to setup Android environment on the Ecplise IDE?

Aim
This entry will demonstrate how to set-up the Android Environment on top of Eclipse IDE.

What you will learn?

  • Eclipse IDE
  • Andrioid Enviornment setup


Pre-requisites:
  1. Eclipse IDE installed correctly
  2. The Android Environmen

Difficulty Level:  Hard
Tips
more details coming soon
Steps
more details coming soon
Related Entries
more details coming soon
Helpful Video



• Use Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer. Launch Eclipse environment.













• Start Eclipse, then select Help > Install New Software















• The dialog that appears, click the Available Software tab.

















• Click on Add Site button, In the Add Site dialog that appears, enter this URL in the "Location" field https://dl-ssl.google.com/android/eclipse/ and Name into Name Field











• Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.

















• In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.

















• Installing windows will look like this
















• Restart your Eclipse environment
• Download SDK from here http://developer.android.com/sdk/index.html













Configuring the ADT Plug-in
• Select Window > Preferences... to open the Preferences panel.














• Select Android from the left panel.
• For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
• Click Apply, and then OK.


















Adding Android Platforms and Other Components
Before adding SDK components disable your antivirus services.
• Goto Windows>> Android SDK and AVD Manager














• Launch Android SDK and AVD Manager














• Click on Available Packages














• Select following options:
1. 'Tools -> Android SDK Tools'  and 'Tools -> Android SDK Platform Tools'.
2. Complete package for Android SDK, API 8
5. Extras -> Google USB Driver Packag
• And click on Install Selected button.














• Click on Install button.













Creating an AVD
An Android Virtual Device (AVD) is a device configuration for the emulator that allows you to model real world devices. In order to run an instance of the emulator, you must create an AVD.
• Select Window > Android SDK and AVD Manager.














• Click New to create a new AVD.
• Fill in the details for the AVD.
• Give it a name, a platform target, an SD card size, and a skin (HVGA is default).
• Click on Create AVD.




















Running on the emulator
• To run your application, select Run > Run from the Eclipse menu bar.


















Creating an Android Project

The ADT plug-in provides a New Project Wizard that you can use to quickly create a new Android project.
• Select File > New > Project














• Select Android > Android Project, and click Next.




















• Select the contents for the project:
1. Enter a Project Name. This will be the name of the folder where your project is created.
2. Under Contents, select Create new project in workspace. Select your project workspace location.
3. Under Target, select an Android target to be used as the project's Build Target. The Build Target specifies which Android platform you'd like your application built against.
• Under Properties, fill in all necessary fields.
1. Enter an Application name. This is the human-readable title for your application — the name that will appear on the Android device.
2. Enter a Package name. This is the package namespace (following the same rules as for packages in the Java programming language) where all your source code will reside.
3. Select Create Activity (optional, of course, but common) and enter a name for your main Activity class.
4. Enter a Min SDK Version.














7 comments:

  1. There is no link for the Android Environment download, in the pre-requisites section

    ReplyDelete
  2. I have a problem installing Android SDK on my Windows 7 machine.

    I am installing the latest version (14) of Android SDK and I'm getting the following error :

    "Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list.xml, reason: Connection to https://dl-ssl.google.com refused"

    Will try version 13 in case it is something to do with the latest version.

    ReplyDelete
  3. can you please check it on Win Xp as I don't have Win 7 machine... ?

    pls suggest otherwise i would need to lok into the exercise on win 7

    ReplyDelete
  4. please use XP for this exercise right now, I am working on Cucumber exercise yet, once I will be done them wil look into this on Win 7 as well

    ReplyDelete
  5. In the pre-requisites section, you say "click here to download" but there is no link. Can you please add the link ?

    Thanks.

    ReplyDelete
  6. There are some images that are missing ?

    ReplyDelete