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