Setting up Eclipse for Android development

Curious to see what the Android platform has to offer, I decided to try out some basic app development with it.

What you need:
  • Android SDK
  • Java SDK (JDK)
  • Eclipse

What I got: (for this tutorial)

File Setup:
I put all my files in a common folder, just to make things easier to find.
You can put them anywhere else, just remember to adjust the pathnames in this tutorial accordingly.

Create a folder "D:\Android" and extract the contents of both "android-sdk-windows-1.1_r1.zip" and "eclipse-SDK-3.4.2-win32.zip" into it.

Then create a folder "D:\Android\workspace" to save your Eclipse projects.

The folder should now contain 3 folders:
  • D:\Android\android-sdk-windows-1.1_r1\
  • D:\Android\eclipse\
  • D:\Android\workspace\

Installing ADT Plugin for Eclipse:

Starting up "D:\Android\eclipse\eclipse.exe" will load the Eclipse IDE.
When Eclipse asks you what workspace to load up, select "D:\Android\workspace".

(optional)
Click "Use this as the default and do not ask again" if you don't plan on changing your workspace.

Once its done loading, close the welcome screen.

Go to "Help -> Software Updates -> Available Software -> Add Site".
Paste in https://dl-ssl.google.com/android/eclipse (or http://dl-ssl.google.com/android/eclipse if the other site isn't working).
Expand the new Android node and wait for it to fetch some information.
Once it loads, select "Developer Tools" and click the "Install" button.
This will take a while to finish.
Restart Eclipse when prompted.

Configuring ADT Plugin:
Once its done reloading, there is one last step in configuring Eclipse before its ready for use.
Go to "Windows -> Preferences -> Android -> Browse".
Select "D:\Android\android-sdk-windows-1.1_r1" and click OK.

You are now ready to develop with the Android platform.



Testing:
To test out your setup, right click on the package explorer and select "New -> Project"
Select "Android -> Android Project" and click "Next".

Since its easier to test with some existing code, we're going to use the sample project "LunarLander".
Click on "Create project from existing source" and then click "Browse".
Select "D:\Android\android-sdk-windows-1.1_r1\samples\LunarLander" and click "Finish".

Go to "Run -> Debug -> Android Application".

The emulator should start up and display "A N D R O I D _" on a black screen for a few moments. It'll take a little bit longer to load up the Android OS, but eventually the LunarLander application should start up.

Enjoy!
 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog