Android-Technical tutorial-Basics of debugging programs, print out what you want to print on the console

Source: Internet
Author: User

These two days, I am crazy about working overtime for the company and catching up on projects. If you are free tonight, I will write a tutorial on printing scalar or needed characters on the android console.
The general printing method of Java is system. Out. println (""); the result is also displayed on the IDE console. However, on the Android platform, system. Out. println (""); you cannot see the printed messages. Because the printing method provided by Android is log. V, this object needs to be imported into import Android. util. log; and then it can be used. The view result is not in the IDE console Panel. In the log panel provided by Android, you can select debug mode in the upper-right corner of IDE to view the log panel.
Below is the test code written for this tutorial

Package com. Google. Android. testlog;

Import Android. App. activity;
Import Android. OS. Bundle;
Import Android. util. log;
/* The copyright of this tutorial is owned by the http://blog.csdn.net/wudifeng blog owner, the code is freely used, If You Want To reprint please indicate the source, this is to write the tutorial people have to respect at least, thank you :)
*/
Public class testlog extends activity {
/** Called when the activity is first created .*/
@ Override
Public void oncreate (bundle icicle ){
Super. oncreate (icicle );
Setcontentview (R. layout. Main );
Log. V ("debug", "message ............");
}
}

NOTE 1: The attachment is a description.

 

 

 

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wudifeng/archive/2009/05/01/4140306.aspx

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.