您的位置:首页 > 移动开发 > Android开发

Android Development Notes-2

2015-12-13 00:28 483 查看
Summary:SDK, ADB, Active, Intents and Tasks

-The Android SDK is made of mostly off-the-shelf components, plus some purpose-built components. In many cases, configurations, plug-ins, and extensions adapt these components to Android. The Android SDK is a study in the efficient development of a modern and
complete SDK.

-adb is a program that enables you to control both emulators and devices, and to run a shell in order to execute commands in the environment of an emulator or device.

-The Dalvik Debug Monitor Server (DDMS) is a traffic director between the single port that Eclipse (and other Java debuggers) looks for to connect to a Java Virtual Machine

(JVM) and the several ports that exist for each Android device or virtual device, and for each instance of the Dalvik virtual machine (VM) on each device.



-Android introduces a richer and more complex approach by supporting multiple application entry points. Android programs should expect the system to start them in different places, depending on where the user is coming from and what she wants to do next.

-An Android activity is both a unit of user interaction—typically filling the whole screen of an Android mobile device—and a unit of execution. When you make an interactive Android program, you start by subclassing the Activity class.

-How, then does one activity invoke another, and pass information about what the user wants to do? The unit of communication is the Intent class. An Intent represents an

abstract description of a function that one activity requires another activity to perform

[java] view
plaincopy





public class TestActivity extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

}

}

-When the system starts this activity it calls the constructor for TestActivity , a subclass of Activity , and then calls its onCreate method. This causes
the view hierarchy described in the main.xml file to load and display. The onCreate method kicks off the life cycle of the Activity

-Each activity in an Android application is largely separate from other activities

-applications describe an Intent that they want to execute and ask the system to find one that matches



Next: Android Component
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: