Getting started with Android development using Eclipse

Getting started with Android development using Eclipse

Since Marthijn is having his new Android phone we decided to discover Android developing with the free IDE Eclipse. It took some time to get Eclipse working. We followed a Hello World tutorial from the Android website which helps you quite along.

My first Android app

I had some trouble starting a new project since I kept having the error message: “A SDK target must be specified”. This was fixed by reinstalling the Android plugin for Eclipse and running the latest Eclipse and Android plugin updates.

Finally I could run my first Hello world progam (see screenshot below). I developed on my Samsung NC10, which has a 1.6Ghz Atom N270 processor. It turned out this was a bit too slow for Android development. Starting the emulator already takes over 5 minutes. The most annoying thing is that while the Android emulator was still starting just when I got the feeling it did nothing.

This forum thread showed me an interesting command:

c:\windows\system32> adb logcat

Which shows the Android device log. When I started my Android application, I opened a command prompt and executed this command as well. I shows me what the Android emulator is currently loading or executing and looks like:

D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): GC freed 21701 objects / 961680 bytes in 582ms
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/KeyguardViewMediator( 56): pokeWakelock(5000)
D/KeyguardViewMediator( 56): pokeWakelock(5000)
D/KeyguardViewMediator( 56): pokeWakelock(5000)
D/KeyguardViewMediator( 56): pokeWakelock(5000)
D/KeyguardViewMediator( 56): pokeWakelock(5000)
D/KeyguardViewMediator( 56): pokeWakelock(5000)
W/WindowManager( 56): No window to dispatch pointer action 1
I/ActivityManager( 56): Displayed activity com.HelloWorld/.HelloWorld: 8633570
ms (total 8633570 ms)
I/ARMAssembler( 56): generated scanline__00000077:03515104_00000000_00000000 [
33 ipp] (47 ins) at [0x4958a8:0x495964] in 7616890 ns
E/gralloc ( 56): [unregister] handle 0x4b3308 still locked (state=40000001)
I/ARMAssembler( 56): generated scanline__00000177:03515104_00001001_00000000 [
91 ipp] (114 ins) at [0x4ce248:0x4ce410] in 5393144 ns
E/gralloc ( 56): [unregister] handle 0x342328 still locked (state=40000001)
I/ActivityManager( 56): Start proc com.android.inputmethod.pinyin for service
com.android.inputmethod.pinyin/.PinyinIME: pid=243 uid=10004 gids={3003, 1015}
D/ddm-heap( 243): Got feature list request
D/dalvikvm( 243): Trying to load lib /system/lib/libjni_pinyinime.so 0x43d01898

D/dalvikvm( 243): Added shared lib /system/lib/libjni_pinyinime.so 0x43d01898
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting
D/dalvikvm( 56): threadid=15: bogus mon 1+0>0; adjusting

In this console I saw my Android emulator was still loading while I thought it stopped 🙂 Now I could run my application in the emulator, but I thingk Android development goes way faster on my MacBook Pro (when my MacBook is fixed) than on my Samsung NC10.

2 thoughts on “Getting started with Android development using Eclipse

  1. You should try enabling debugging mode on a physical android device, connecting it with usb and try running “adb logcat” again, it’s very interesting to see all the debug messages and activities on an actual running phone!

    Also, you can debug applications on a real device if it is connected. Create a new android debugging profile and select “manual” in the target tab. You can now choose your connected Android device when you hit the debug button, omitting the emulator!

Leave a Reply

Your email address will not be published. Required fields are marked *