Understand Adb, DDNS LogCat Windows, Devices Windows, etc.


     The full name is Dalvik Debug Monitor Service

    Dalvik virtual machine debugging monitoring service in the Android development environment

     Debugging tools for Android application development provided in Eclipse

Four important views of DDMS:

Logcat: View log output

File Explorer: View internal system files

Decices: Displays associated Android devices

Emulator Control: Action controls the associated Android device


Note: Open four views in Eclipse for easy debugging

Logcat window


File Explorer window


Devices window


Emulator Control window



Compare Log with System.out:


Related ApIs:

//Main interface Activity

public class MainActivity extends Activity{

private Button btn_main_download; // View generation member variables in the layout

protected void onCreate(Bundle savedInstanceState) {
    //Load the layout and generate the corresponding attempt object
    //Call the onCreate method of the parent class
        super.onCreate(savedInstanceState);
        

        setContentView(R.layout.activity_main);

 //1. Get Button object
        btn_main_download=(Button) findViewById(R.id.btn_main_download);
        //2. Set click listener for button
        btn_main_download.setOnClickListener(new View.OnClickListener() {

        //In the callback method:

public void onClick(View v){//Called when the user clicks the button

//1. A text prompt to start downloading

//1. Context can pass Application or Activity object 2 Display text 3. Time toast LONG SHORT

Toast.makeText(MainActivity.this, "Start downloading...",Toast.LENGTH_SHORT).show();

//2. Update Button display text

btn_main_download.setText("Downloading...");

}});



 //Test Log
        Log.i("TAG", "i() print information");//General information log

        Log.e("MainActivity", "e() print information");//Error log

measurement unit:


Comparison of size units:

dp vs px comparison?

Length in px, which gets bigger on bad phones and smaller on good phones

In dp, it will not change


About the colors:



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325580378&siteId=291194637