Android system. Out. println console Output Method

Source: Internet
Author: User
First, Android has added a logcat window for testing convenience. If this window does not appear in your console, you can enable it in WINDOW> show View> logcat.

After enabling, find a green plus sign and add a filter. If you want to use system. if the output is out, the filter name is system. out, by log tag is system. out.

If you use output like log. I, the name is log. I, and the tag is your log. I tag.

In addition, if you directly connect your Android phone to your computer and the debug mode is enabled on your mobile phone, the simulator on your PC cannot be output unless you unplug your mobile phone.

 

 

Another alternative method is to call the android class to output information in logcat, Code As follows:

ImportAndroid. util. log;
Public ClassUtil {
Private Final StaticString tag = "printout ";

Public Static VoidPrinttextlog (string log ){
Log. V (TAG, log );
}
}

Tag is the tag for output information. The call method is log. V (string tag, string message ).
Open the logcat window (window-> show view-> logcat) in debug, add a filter, and set "by log tag" to a custom tag.

 

 

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.