Tales of an Ex-Googler

Debugging Android Widget

Posted in Uncategorized by jeansworld on October 20, 2010

Debugging your widget is not quite as automated as debugging a regular application, but luckily it’s not too difficult either. You just have to know what to do…so here are the instructions, from Shantanu’s Technophilic Musings

1. Press “debug” on the eclipse menu (or “run” it doesn’t seem to matter)

2. Once the widget apk is sync’ed and installed onto your emulator/device, switch your eclipse workspace to DDMS mode. You can either do this by pressing the “DDMS” labeled button on your top right corner or if you can’t find it, then do it by going to “Window->Open Perspective->DDMS”.

3. Select the process name of your widget from the list of processes shown. By default, this list appears at top left of DDMS window. (See screenshot below). If you can’t see your widget’s process name in the list, it is possible that the widget is not added to the home screen yet. So, do so.

4. Press the green debug button above the process list (See screenshot below)

5. And that’s it. Now, if you had put a breakpoint in the code, do something that executes that piece of the code.

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.