JNI:
http://blog.csdn.net/droidpioneer/article/details/6787571
其中的目录:
internal目录:\frameworks\base\core\java\com\android\internal\os
RegFNIRec gRegJNI[]数组对应的函数在:\frameworks\base\core\jni
jniRegisterNativeMethods函数在:\dalvik\libnativehelper\JNIHelp.c中调用RegisterNatives 在\dalvik\vm\Jni.c中
android进程:
the system assigns each application a unique Linux user ID。每个应用程序有一个Linux user ID
Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.
Android starts the process when any of the application's components need to be executed
android component:
Each component is a different point through which the system can enter your application。they areActivities、Services、Content providers、Broadcast receivers。
android process 五类按优先级排列:
Foreground process Visible process Service process Background process Empty process
android线程:
When an application is launched, the system creates a thread of execution for the application, called "main.",alse called UI thread.The system does not create a separate thread for each instance of a component(android component). All components that run in the same process are instantiated in the UI thread, and system calls to each component are dispatched from that thread.Consequently, methods that respond to system callbacks (such as onKeyDown()
to report user actions or a lifecycle callback method) always run in the UI thread of the process.
the Andoid UI toolkit is not thread-safe (components from the android.widget
and android.view
packages). So, you must not manipulate your UI from a worker thread—you must do all manipulation to your user interface from the UI thread. Thus, there are simply two rules to Android's single thread model:
- Do not block the UI thread
- Do not access the Android UI toolkit from outside the UI thread
修改UI线程中控件的状态,最好的方法是用AsyncTask ;