Download and unpack Android SDK.
File name I ended up downloading was android-sdk_r3-windows.zip.
Changed android.bat inside Android SDK according to this tip.
Start a command prompt as administrator and run the following command from the tools folder of the Android SDK:
android update sdk
Fixed error “Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings.” by doing as it says and then clicking Update all button under Installed packages. Not sure why this was needed because the https link loaded fine in my browser.
Select “SDK Platform Android 1.5”, Accept and then Install Accepted. Actually I ended up downloading all platforms (not sure why, but I have room so what the heck). This means 1.1, 1.5, 1.6, 2.0, documentation
Start Eclipse and accept the default workspace location (or change – it is just the place to put your projects and files). Choose Help, Install new software. Input the following link and click Add button.
Type a name for the link/source and ok. Check “Developer Tools” once it appears in the list and click Next, Next, I Accept and Finish. I got a warning about unsigned content, but accepted with OK. Also, a Yes for restarting Eclipse.
Choose Window, Preferences inside Eclipse. Under Android, Browse for the location where you unpacked the Android SDK. I clicked Apply, but it seemed to take a while and maybe another click and/or another Browse attempt before the list filled up with my targets “Android 1.1”, “Android 1.5” etc. OK.
Choose Window, Android SDK and AVD Manager inside Eclipse. Click New under Virtual Devices. Type a name for your phone emulator and select your target platform, Android 1.5 for me. Type a size for your emulated SD card, I chose 200 MiB. I did not create any additional hardware abstractions (yet, will probably come back later). Then Create AVD and close the dialog box.
Choose File, New, Project inside Eclipse. Select Android Project and Next. Type a name for your project and select your target platform. I’m going for Android 1.5 which is on my HTC Hero at the time of this writing. Also input values for the following fields, for example:
Application name: My App
Package name: com.mycompany.myapp
Create Activity: MainActivity
And complete with a click on Finish. Now, you may think nothing has happed, but it has. Just click icon on right which saids “Workbench” when you hover on it. There you have your project and source files to work with!
Click Debug button in toolbar in order to test the application in the emulator. Select Android Application and off you go. Even on my Intel Core i7 processor it takes some time to get the app running inside the emulator, about 1 minute! Note however, that if you keep the emulator running, it only takes about 5 seconds to launch a new version of my application from within Eclipse.
That’s it. Now off for some educational reading in how to write Android applications. I hope to get back on that matter.
62 Responses to “Getting ready for Android development”