Android中的PID,UID,TID
来源:互联网 发布:最新流行歌曲网络歌曲 编辑:程序博客网 时间:2024/04/29 02:23
Source code:
package com.inanwong.main;import android.app.Activity;import android.os.Bundle;import android.os.Process;import android.util.Log;public class MainActivity extends Activity {private static final String TAG = MainActivity.class.getSimpleName();/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);/** * Returns the identifier of this process's user. */Log.e(TAG, "Process.myUid() = " + Process.myUid());/** * Returns the identifier of this process, which can be used with * killProcess and sendSignal. */Log.e(TAG, "Process.myPid() = " + Process.myPid());/** * Returns the identifier of the calling thread, which be used with * setThreadPriority(int, int). */Log.e(TAG, "Process.myTid() = " + Process.myTid());/** * Returns the thread's identifier. The ID is a positive long generated * on thread creation, is unique to the thread, and doesn't change * during the lifetime of the thread; the ID may be reused after the * thread has been terminated. */Log.e(TAG, "Thread.currentThread().getId() = "+ Thread.currentThread().getId());Log.e(TAG, "getMainLooper().getThread().getId() = "+ getMainLooper().getThread().getId());/** * Returns the thread's identifier. The ID is a positive long generated * on thread creation, is unique to the thread, and doesn't change * during the lifetime of the thread; the ID may be reused after the * thread has been terminated. */Log.e(TAG,"((getApplication().getMainLooper()).getThread()).getId() = "+ ((getApplication().getMainLooper()).getThread()).getId());/** * Return the identifier of the task this activity is in. This * identifier will remain the same for the lifetime of the activity. */Log.e(TAG, "getTaskId() = " + getTaskId());/** * The kernel user-ID that has been assigned to this application; * currently this is not a unique ID (multiple applications can have the * same uid). */Log.e(TAG, "getApplicationInfo().uid = " + getApplicationInfo().uid);/** * The name of the process this application should run in. From the * "process" attribute or, if not set, the same as packageName. */Log.e(TAG, "getApplicationInfo().processName = "+ getApplicationInfo().processName);new Thread(new Runnable() {@Overridepublic void run() {// TODO Auto-generated method stubLog.e(TAG, "Thread.currentThread().getId() = "+ Thread.currentThread().getId());}}).start();}}
Log information:
10-12 01:57:30.885: ERROR/MainActivity(253): Process.myUid() = 10032
10-12 01:57:30.885: ERROR/MainActivity(253): Process.myPid() = 253
10-12 01:57:30.885: ERROR/MainActivity(253): Process.myTid() = 253
10-12 01:57:30.885: ERROR/MainActivity(253): Thread.currentThread().getId() = 1
10-12 01:57:30.885: ERROR/MainActivity(253): getMainLooper().getThread().getId() = 1
10-12 01:57:30.885: ERROR/MainActivity(253): ((getApplication().getMainLooper()).getThread()).getId() = 1
10-12 01:57:30.885: ERROR/MainActivity(253): getTaskId() = 3
10-12 01:57:30.885: ERROR/MainActivity(253): getApplicationInfo().uid = 10032
10-12 01:57:30.885: ERROR/MainActivity(253): getApplicationInfo().processName = com.inanwong.main
10-12 01:57:30.914: ERROR/MainActivity(253): Thread.currentThread().getId() = 8
- Android中的PID,UID,TID
- android中的Uid、Pid、Tid
- android中的Uid、Pid、Tid
- Android中的PID,TID和UID
- Android 开发中的 uid pid tid
- Android中的PID,TID和UID (关于AIDL的demo)
- Android中的UID和PID意义
- linux中的pid与tid
- Android Pid和Uid
- Android:Uid&Pid,etc.
- android UID和PID
- android IPC通信中的UID和PID识别
- android IPC通信中的UID和PID识别
- android IPC通信中的UID和PID识别
- android IPC通信中的UID和PID识别
- android IPC通信中的UID和PID识别
- android IPC通信中的UID和PID识别
- android IPC通信中的UID和PID识别
- 从图片中的一点取色
- JavaScript:全面解析Ajax跨站数据传输和iframe跨域名js调用(6种方法)
- 对STL的string进行格式化输出
- Java程序练习-bridging signals----最长升序列
- javaScript获得当前时间
- Android中的PID,UID,TID
- 打印网页时去掉标题、页码、网页地址方法
- 虚拟机提供的网络连接方式解析
- 有关WM_NOTIFY的理解
- java创建删除文件或文件夹的公共类
- openGL学习--顶点数组
- ASPXGridView外观显示
- [IT 男人帮] 国足主场0-1负伊拉克 世界杯出线形势严峻
- strip 命令