[Android Development Learning] debugging of Android applications

Source: Internet
Author: User

When debugging a program, parameter output is helpful for us to know whether the entire program operates according to our own logic. There are many methods for outputting information in the java program on the Android platform on the console: 1. system. out. println ("... "); 2. android. util. log ("... "); now, let's look at the two inputs to see how we can extract the content of our only relationship, and the rest of the output will disappear on the other side of the world. I. write code: First, check out my java program: [python] package wyf. zcl; import android. app. activity; import android. OS. bundle; import android. util. log; public class MyActivity extends Activity {/** Called when the activity is first created. * // @ Override public void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. main); System. out. println ("first System. out. println "); Log. D ("TAG", "first tag") ;}} where: System. out. println ("first System. out. println "); Log. d ("TAG", "first tag"); the above two lines are our current test example. (In fact, I downloaded an example from the Internet and then imported it. The steps for importing the project file are described at the end .) II. open the Eclipse debugger (DDMS): 1. open Eclipse, and in the upper left corner of the interface, a plus sign is displayed. move the cursor up and the "open perstective" is displayed. Click here to see the red part, in the displayed dialog box, select the <DDMS> Option and click [OK]. The program automatically jumps to the main interface of the DDMS debugger. In the open DDMS interface, we mainly care about the red circle, that is, the [LogCat] and the [+] button below. III. configure the Eclipse debugger (DDMS): click the "+" button under the LogCat label on the main interface of DDMS. Here we set the information output filter. My configuration is as follows: click "run, the output result is as follows: the output is as follows. We just want to see the information. ========================================================== ========================================================== ========================================================== Record problems: how to import an existing project in Eclipse? Solution: Open eclipse, [File] --> [Import...] --> [Existing Projects into WorkSpace. Record problem: the error message "Android requires compiler compliance level 5.0 or 6.0" is displayed. found '1. 7 'instead. please use Android Tools> Fix Project Properties. solution: Right-click the Project and choose> Android Tools> Fix Project Properties. Run the command again. If the problem persists, check Project-> Properties-> Java Compiler and confirm that the Compiler compliance level is set to 1.7 and enable specific seetings.

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.