-
Android 的静默安装与静默卸载功能 (SilentInstaller)
资源介绍
详情见:Android 静默安装和静默卸载(系统层)
http://blog.****.net/zhouyuanjing/article/details/78507606
安装:
Intent intent = new Intent("android.intent.action.SILENT_PACKAGE_INSTALL");
intent.putExtra("silent_install_file", "/sdcard/Helloworld.apk");
intent.putExtra("silent_install_auto_start", true);//是否安装并启动
intent.putExtra("silent_install_start_clazz", "com.example.helloworld.MainActivity");//如果安装并启动,则需指定activityName
sendBroadcast(intent);
卸载:
Intent intent = new Intent("android.intent.action.SILENT_PACKAGE_DELETE");
intent.putExtra("silent_delete_package", "com.example.helloworld");//指定需要卸载apk的包名
sendBroadcast(intent);