进程自杀他杀|获取SIM卡信息|安装APK

    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);
    }






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值