public void killProcessBut(View v){
// //获取当前进程PID
// int pid = android.os.Process.myPid();
// //此方法只能自杀[不能杀别的进程]
// android.os.Process.killProcess(pid);
//杀死别的进程-不能自杀
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
am.killBackgroundProcesses(com.example.email);//杀死者的包名
}
他杀权限:Manifes.xml
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
/**
* 获取SIM卡IMSI码
* SIM:移动用户的标示
* IMSI:由MCC,MNC,MSIN组成,
* MCC:为国家编号码 中国:460
* MNC:网络id 2位数组成[ 移动:00-联通:01-电信:03]
* MSIN:等长11位数-电话号码
*
* 业务-
* 移除呼叫记录 -
* 读取SIM卡联系人信息-
* @param v
*/
public void getOperator(View v){
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
tm.getSubscriberId();
tm.getNetworkOperator();
tm.getNetworkOperatorName();
tm.getNetworkType();
}
/**
* 安装APK
* @param v
*/
public void installerBut(View v){
//apk 路径
String path = EditText.getText().toString();
Intent intent = new Intent("android.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
intent.setDataAndType(Uri.fromFile(new File(path)), "application/vnd.android.package-archive");
startActivity(intent);
}