Getting started with Android ddms

Source: Internet
Author: User

In fact, I don't just want to introduce the ddms tool, but I want to talk about the log. Anyone who has experience in developing and maintaining the system should know the importance of the log, whether you store logs in the form of text, database, or IDE, this is necessary. Generally, logs are used to record system running exception information, so that we can learn about the exception in non-debugging of the program.

We usually choose debugging when there is a problem during development. Of course, this is the most direct and effective way to locate the problem, but the speed is relatively slow, if you can view the problem log, it will be much faster.

During system maintenance, the importance of logs is highlighted, because the system is already running on the server, and it is difficult for us to debug the logs, even debugging sometimes fails to recover or catch exceptions at the time (the test environment is different from the real environment ), in particular, some exceptions that we think are "Supernatural" (people who often maintain the system will understand ), in particular, external exceptions such as file read and write permissions, office read and write permissions, network exceptions, and performance bottlenecks. At this time, it is necessary for us to try catch where these exceptions may occur. Once the system encounters an exception, our first response is to view the log file, analyze the problem, locate it quickly, and handle it in a timely manner.

The above is a bit too long. Let's get down to the point and see what Android ddms can bring to us:

The full name of ddms is Dalvik debug monitor service, that is, Dalvik debugging Monitoring Service, which is a visual debugging monitoring tool. It monitors the background logs of system operation, as well as the status of system threads and simulators. In addition, it can also send and receive text messages, call and send GPS location information.

Start ddms

1. in the upper-right corner of the eclipse interface, click the Add tool icon and select ddms to confirm. The ddms icon appears in the upper-right corner of eclipse. Click this icon to enable ddms.

 

DdmsFunctions

1.DevicesYou can view the details of all the simulators connected to ddms and the app processes running on each simulator. the rightmost of each process corresponds to the port connected to the debugger.

 

2.Emulator ControlIt can be used to control the simulator, such as answering the phone, simulating various network conditions based on options, simulating receiving SMS messages, and sending virtual address coordinates for testing the GPS function.

Telephony status: simulates the voice quality and signal connection mode with options.
Telephony actions: simulates the call and sends the SMS to the test terminal.
Location Control: simulates geographical coordinates or simulates Dynamic Route coordinate changes and displays preset geographical identifiers. You can use the following three methods:

(1) Manual: manually send two-dimensional latitude and longitude coordinates to the terminal.

(2) GPX: The GPX file is used to import the sequence to dynamically change the geographic coordinates, so as to simulate the GPS change value during traveling.

(3) kml: import a unique geographical identifier through the kml file and display it on the test terminal dynamically based on the changed geographical coordinates.

3.LogcatIt mainly displays log information, including error, warn, info, debug, verbose, and other 5 types. In the code, use uppercase letters instead:VFor all information,DIs the debug information,IInfo information,WWarning Information,EIs the error message.

The following method is usually used in the code to record logs: log. V () log. D () log. I () log. W () and log. E (). For specific parameters, refer to API.

During project running, we can monitor a lot of system logs here to understand the running status of the system.

4. threads, heap, and file exporler are the most commonly used file exporler file browsers. You can use file exporler to view files in the android simulator and conveniently import/export files.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.