Thursday, April 19, 2012

Debugging In Android

Debugging in Android is more easy and faster than any other application development. DDMS is short for Dalvik Debug Monitor Server, which communicates with the low-level services of a device or emulator. Switch to the DDMS perspective now by selecting Window > Open Perspective > DDMS.






The Devices view, located in the left column of the workbench, is where you will see any Android devices available to your computer. This includes both phones attached to your machine and running emulators. Under each device, you will see all the running processes. There are toolbar buttons on the view for launching the debugger on a process, getting information about heaps and threads, stopping processes, and taking screenshots.
The Emulator Control view, also in the left column, lets you do the following:
  • Set the status of the voice connection.
  • Set the status, speed and latency of the data connection.
  • Simulate an incoming call or SMS from a supplied phone number.
  • Provide a simulated set of points for the GPS via a latitude/longitude point, or GPX/KML file.
  • Using the File Explorer view, accessible as a tab at the top-right of the center column, you can browse the file system of a device. For an emulator or a rooted phone, you will have access to the private directories /data and /system. For non-rooted phones, you will only have access to /sdcard.


    The debugging perspective will provide in-depth information about your applications. Switch to the debugging perspective by selecting Window -> Open Perspective -> Debug .






    The Debug view will show you the running apps being analyzed, and, when stopped on a breakpoint or exception, the call stack of the application as well. The Variables view displays the contents of any local variables at the current breakpoint.
    The LogCat view in the lower right hand corner displays all logging output using the android.util.Log class. You can filter based on tags, or different log levels such as debug, information, error, etc.

No comments:

Post a Comment