The Mindful Coder

Code, yes. But think about it a little first.

Android Development Quirks -1

leave a comment

I just finished my first Android app and I loved the experience. I did come across many many not-so-obvious quirks of Android development – both in the tooling and the platform that I wanted to write in one long post. There was all in this one sticky on my desktop. Deleted it. It even asked me to confirm I wanted to delete it and yet I went ahead and clicked yes.

I’ll just have to try to remember them going forward. For now, here’s one that might confuse you especially if you are debugging your Android app on both emulator and the device..or maybe multiple emulators.

Android debug, error,or log messages can be tracked through LogCat which looks something like this:

Now, while in the midst of happy debugging , if your log messages suddenly stop showing up in logcat – basically nothing is showing up in logcat – then it basically means that Android has for some reasons lost “focus” on your current emulator. This will most likely happen when you are triggering a debug session.

You fix this by opening up the devices view (Window->ShowView->Others->Devices) and selecting the emulator for which you want to see the debug messages. In the screenshot below, I’ve selected the device instead of the emulator. Now go back to the LogCat view and your log including what flew by before you selected the device should show up.

Written by The Fat Oracle

June 25th, 2010 at 8:48 pm