Analysis of Android output log related application skills

Source: Internet
Author: User

Reprinted from: http://developer.51cto.com/art/201001/180265.htm

 

Since the Android mobile phone operating system is one of the most attractive advantages, it is an open-source operating system, and its writing method is simple and flexible, it can easily help users achieve various needs. Here, we will first try to experience the features of log output from Android.

The log class of Android. util can be used to output logs in Android.

For example, after executing the following code, the log is output to the logcat view.

Log. V ("tag", "message ");

Choose WINDOW> show View> logcat in eclipse.

Android output log routine source code (Java)

 
 
  1. Package com. test;
  2. Import Android. App. activity;
  3. Import Android. OS. Bundle;
  4. Import Android. util. log;
  5. Public class testactivity extends activity {
  6. /** Called when the activity is first created .*/
  7. @ Override
  8. Public void oncreate (bundle savedinstancestate ){
  9. Super. oncreate (savedinstancestate );
  10. Setcontentview (R. layout. Main); // log processing
  11. Log. V ("tag", "message ");
  12. }
  13. }

Android output log-related applications are introduced here.

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.