Android DDMS Views Tutorial, Page 2
Android DDMS View #4: Emulator Control
Your app may run perfectly in your IDE, but it isn't destined for a life on the desktop. The Emulator Control view is a powerful tool for testing your app under real-world conditions.
The different options available as part of the Emulator Control tab are:
- Telephony Status: Test your app under different network conditions, including network data I/O speed and latency.
- Telephony Actions: Simulate incoming calls and SMS messages.
- Location Controls: Does your app have location-specific functionality? This option can be used to simulate changes of location, either manually or by using the GPX (GPS eXchange file) or KML (Keyhole Markup Language Files) options.
Android DDMS View #5: File Explorer
The File Explorer allows you to view files, and to copy them between the emulator and the device, in a similar way to the abd
Android DDMS View #6: Heap View
Are you forever running out of memory? Then it's time to find out exactly what objects are being created. The heap view can be used to analyze memory usage and to manually invoke garbage collection. To invoke garbage collection and update the heap with the latest memory analysis, you:
- select the process you wish to analyze from the Devices tab.
- select Update Heap to start gathering heap information.
- select the Heap tab. Click Cause GC to invoke garbage collection.
Once the operation has been completed, you will see a group of object types, alongside the memory that has been allocated for each object.
Android DDMS View #7: Threads
The thread view allows you to access the thread information for a selected process. To check thread information, open the Devices tab and select the process you wish to view thread information for. Then, it's simply a matter of clicking Updates Thread and opening the Threads tab.
At this point you may receive a "Thread updates not enabled for selected client (use toolbar button to enable)" message. You can easily rectify this by opening the Windows menu, selecting Preferences and Android, followed by DDMS. Check the Thread Updates Enabled by Default box. Your thread information should now display correctly.
Android DDMS View #8: Network Statistics
The Network Statistics tab is useful for tracking when your app is making network requests. Monitoring data transfers (in particular how and when they occur) allows you to modify your app to optimize network usage and battery efficiency.
This article has covered the core functionality DDMS offers Android developers. When testing your app, bear in mind that although selecting the DDMS perspective will bring up the default views, you can easily add additional views by opening the Window menu and then Show View, as needed. Or, if you just want to reorganize the DDMS layout, this is simply a matter of dragging and dropping the different panes around your dashboard.
Page 2 of 2