我怎么能写一个程序来安装和卸载了Android设备的应用程序? [英] How can I write a program to install and uninstall an app over android device?
本文介绍了我怎么能写一个程序来安装和卸载了Android设备的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想写它可以安装和卸载了超过Android设备提供这些功能的Android device.As的应用程序,但我应该在哪里开始,需要哪些文件被视为开发自己的应用程序。请帮我。
I want to write a program which can install and uninstall an application over android device.As these features are provided over android device,but from where should i start and which files are required to be seen to develop my own application. please help me out.
日Thnx提前。
Praween
推荐答案
有关安装code一样,
For installation code like that
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
startActivity(intent);
有关卸载试试这个。
Intent intent = new Intent(Intent.ACTION_DELETE, Uri.fromParts("package",
getPackageManager().getPackageArchiveInfo(apkUri.getPath(), 0).packageName,null));
startActivity(intent);
让我知道,如果任何问题。
Let me know if any issue
这篇关于我怎么能写一个程序来安装和卸载了Android设备的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文