Android Learning Notes (9) Android program debugging Learning

Source: Internet
Author: User
Tags log log

The 14th lesson of the corresponding Joshui teacher

One, log log output

log.v (tag,message); Verbose mode, print the most specific log
LOG.D (Tag,message); Debug-level logs
LOG.I (Tag,message); Log at info level
LOG.W (Tag,message); Warn-level logs
LOG.E (Tag,message); Log at error level
tag is used to mark the source of the log message with represented. Message is the contents of this log.


Two, Unit test
Step1: Add the following configuration information to the Androidmanifest.xml:
step2 write unit test code
a good way to do this is to create a new source Floderz in the project, write the unit file that you want to test, and add it to the Androidtestcase:
public class Persondaotest extends Androidtestcase {private static final String TAG = "Persondaotest";p ublic void Testadd ( )  //To test the method {log.i (TAG, "Test");} public void Testdelete ()//method {fail ("not yet implemented") to test;}}
Select a method in the test class when testing right-runas->android junit test
The junit form has a green bar to indicate that the test can pass. Red is a problem.


Three, commissioning

Debug is relatively simple, you get started groping.


Report:

Unit Test for Android apps

Android Learning Notes (9) Android program debugging Learning

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.