Thursday, June 28, 2012

Android programming and debugging on Motorola Milestone

Finally I got a Motorola Milestone Android phone today. It’s a beauty; quality solid build, display is bright and brilliant, programs running not super fast but fast enough. It also seamlessly integrates (i.e. synchronize) with Google Mail, Contacts and Calendar.

Can’t wait any longer; I immediate put it on trail as a development phone. It’s quite straight forward on setting up Motorola Milestone as a development device except there’s a little trick (as details below) for Linux (mine is Suse Linux).

Steps
1. Connect Milestone to your PC with USB
2. On Milestone, select “Setting”->”Application Development” and turn on USB debugging. Checked the “Always on when USB connected” option as well.
3. Run the “adb devices” on your PC. It shall print out the connected device with it’s serial number. If you got a print out of “???????” and “no permission” message, restart adb server with root privilege by running the command “adb root”. Retry “adb devices”, and it shall print the serial number.
4. Start Eclipse. You can start Eclipse with your login.
5. Add “android:debuggable=true” to the <application> element in androidmanifest.xml file
6. Now, when you run/debug the application from Eclipse, a devices selection dialog pop up and you can select the connected device to continue.