Here’s a quick help for getting every thing to work. This has successfully worked on Windows 7 64bit and an Android 2.2 driven Samsung Galaxy S phone.
Installing the Android SDK
- Download and install JDK. It’s a requirement for the android SDK.
- Download the zip version of the Android SDK, the recommended .exe installer didn’t work for me as it kept complaining about JDK not being installed.
- Unzip the file to a folder and run SDK Manager.exe. This tool allows you to create new emulators, and download the packages needed for the SDK to be complete. It should provide you with a list of ready-to-download packages to whom I recommend adding the Google APIs if you plan to use the Google Map API.
- From now on, will assume the folder was extracted in C:\android-sdk
Configuring the Samsung Galaxy S USB connection
On your android phone, go to Settings->Applications->Development and check USB debugging.
On the computer now … Even though the android SDK comes with an android usb driver, this latter didn’t work for me, (it did show up the device manager but not in “C:\android-sdk\platform-tools\adb.exe devices“ output) and I was forced to use the official driver by Samsung. You can get this driver here.
Install the driver, plug your phone to your computer and it should new show up in the device manager as ADB Inteface->SAMSUNG Android Composite ADB Interface. Run “C:\android-sdk\platform-tools\adb.exe devices” and you should see your phone in there.
Installing Eclipse and the ADT plugin
This tutorial uses Eclipse Helios (3.6.1) IDE for Java Developers. You can get it from here.
Once installed, go to “Help->Install new software”, click the “Add” button (top right) and fill in the name: “ADT Plugin” and the url “https://dl-ssl.google.com/android/eclipse/”, click ok and install the plugin(s).
Now go to “Windows->Preferences->Android” and Fill in the SDK Location “C:\android-sdk”.
You should now see a small android icon in the tool bar which will open up the SDK manager.
Creating a Virtual Device
With eclipse when you run your application it will either run it on the connected phone or a virtual device. If you’re phone is not available or busy doing something else, I recommend installing this vds. Also this will allow you to test your application on other things than your Galaxy S and other versions of android too.
To do this there are 2 ways, the easy way and the hard way.
The easy way is doing it through the SDK Manager but if your real name happens to be Sélim with an accent (basically an UTF-8 character), this won’t work because the manager puts the configuration files in C:\Users\[your name]\.android\avd, which will cause this “emulator: ERROR: no search paths found in this AVD’s configuration. Weird, the AVD’s config.ini file is malformed. Try re-creating it.” . In this case read, try but don’t complete this next paragraph.
Bring up the SDK Manager, by clicking the android icon in eclipse for instance, select Virtual Devices, and click the new button.
Chose a name (no spaces, will be the folder the name), a target (you can install more versions of the SDK in the SDK manager), a size for an SD card, the Skin should be set to WVGA800 (it’s actually a folder in “C:\android-sdk\platforms\android-8\skins” which contains the images and definition of the layout). Finally, click the “Create AVD”. Once created, you can “start” it to check that everything is fine.
For us people with strange non-iso names, the previous method won’t work and we need to do it manually. Bring up the console by Start->Run->cmd.exe and run the following :
Microsoft Windows [version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. Tous droits réservés. C:\Users\Sélim> cd \android-sdk\tools C:\android-sdk\tools> md ..\avd C:\android-sdk\tools> android.bat create avd -n GalaxyS -t 1 -s WVGA800 -p ../avd/galaxys Android 2.2 is a basic Android platform. Do you wish to create a custom hardware profile [no] (just hit enter) Created AVD 'GalaxyS2' based on Android 2.2, with the following hardware config: hw.lcd.density=240 vm.heapSize=24 C:\android-sdk\tools>
One thing to pay attention to is the -t argument which is the position of the target in the “New Virtual Device” dialog box in the target drop down. This number will change depending on what SDKs you have installed.
That’s it ! Let’s hello world.
First, I hope everything has worked so far like it did for me.