From Eclipse:
- Select Help -> Install New Software
- Select the 'Add' button from the dialog
- In the 'Location' field, enter the following and push OK:
- https://dl-ssl.google.com/android/eclipse/
- The Install dialog will load an entry called 'Developer Tools'. Select it and push 'Next'
- Proceed through the next few dialogs
- Wait for the plugin to finish installing and then restart Eclipse
- You may need to approve a few security warnings during this process
![]() |
| Adding the Android plugin update site to Eclipse |
![]() |
| Installing the Android plugin |
Setup the SDK
Once Eclipse restarts:
- A welcome dialog should appear
- Select 'Install new SDK', and also select the following options:
- 'Install the latest available version of Android APIs'
- 'Install Android 2.1'
- Confirm the next few dialogs and begin installing the SDK
- This will download quite a few files and may take a while
- Restart Eclipse again
- Select Window -> Android SDK Manager
- From the SDK Manager dialog, select the following packages and then push 'Install Packages':
- Android 2.2.3
- Android 2.2
- Android 2.1
- Confirm the install dialogs and start the installation
- This will take a little while
- There may be some dialogs that popup for some MOTODEV stuff. You can just cancel these.
![]() |
| Installing the Android SDK |
![]() |
| Selecting our packages. You can install more if you want |
Take it for a spin!
At this point you're basically all set to start developing for Android! The SDK comes with many sample projects that demonstrate various features and APIs available to you. We'll try out the Lunar Lander sample to make sure everything is working properly.
From Eclipse:
- From the menu, select File -> New Project
- From the New Project dialog, select Android -> Android Sample Project
- Select Android 2.1 as the build target
- Select Lunar Lander from the available samples
The project should now appear in your workspace. Viewing the source code of the sample projects is the best way to become more familiar with the Android APIs and the overall structure of Android applications.
Next, we can run startup the emulator.
- Select Window -> AVD Manager. (AVD stands for Android Virtual Device)
- Create a new AVD by selecting 'New' and filling in the following:
- Name: a descriptive name of the device you are creating
- Target: Use 2.1
- SD Card Size: 256mb
- Leave the rest as default values
Your new AVD should appear in the list of available AVDs.
- Select it and push 'Start'. You can leave the launch options as the defaults.
- It may take a minute or two to load
When the emulator fully starts up, you'll see a basic Android homescreen. You can click on any of the pre-installed apps or use the other buttons to control the device. Now let's load our Lunar Lander.
From Eclipse:
- Right click the Lunar Lander project (the top level folder) from the Package Explorer
- Select Run As -> Android Application
The application will be loaded into the emulator and should automatically startup. You should be able to play the game with your computer's keyboard.
![]() |
| Select Android Sample Project from the New Project wizard |
![]() |
| The sample projects available in the Android 2.1 SDK |
![]() |
| How the Android project appears in the Eclipse package explorer |
![]() |
| Creating a new Android Virtual Device (AVD) |
![]() |
| The Android emulator running a 2.1 AVD. |
![]() |
| The Android emulator running the Lunar Lander sample project from the 2.1 SDK |
Summary
Google makes it pretty easy to get setup with a basic sample project and emulator. By exploring the different samples they bundle you can start discovering the capabilities available. Hopefully you have fun creating the next great Android app! If you have any more questions, or run into problems, post in the comments section.
Resources
http://developer.android.com/sdk/index.html










No comments:
Post a Comment