基本上,我想从远程服务器在我的android设备上安装/卸载一个应用程序。
我从远程服务器向我的设备发送一条特定的消息(例如安装或卸载)。
但是,当设备启动该进程时,将启动系统生成意图,并显示下面的消息。
必须按下OK按钮才能继续该过程。
如何在远程服务器上以编程方式按下此按钮并继续该过程?
希望你能理解我要解释的内容。
有什么建议或想法吗?
发布于 2012-11-21 16:36:19
恐怕只有从play store才能做到这一点。点击回收站,但不是外部应用。
您只能要求系统卸载应用程序。Here's the reference。
另外,正如评论中指出的那样:
当您打开对话框时,选项是user-driven.
发布于 2012-11-26 19:51:31
我正在寻找相同的解决方案,通过发送短信从服务器卸载任何应用程序。下面我给出一些示例代码,它可能会帮助you.But你需要你的设备作为根设备。要对设备进行根操作,请从以下链接http://forum.xda-developers.com/showthread.php?t=803682下载s/w
代码是
public class MainActivity extends Activity {
Context context;
// boolean isEnabled;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Uninstall();
}
private void Uninstall() {
Process process;
try {
process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes("mount -o remount,rw -t rfs /dev/stl5 /system; \n");
os.writeBytes("rm -r /system/app/ActionsContentViewExample.apk; \n");
os.writeBytes("mount -o remount,ro -t rfs /dev/stl5 /system; \n");
} catch (IOException e) {
e.printStackTrace();
}
}
}
https://stackoverflow.com/questions/13488677
复制相似问题