我怎么能写一个程序来安装和卸载了Android设备的应用程序?应用程序、程序、设备、我怎么能

2023-09-06 06:19:45 作者:酒貧斷腸氺

我想写它可以安装和卸载了超过Android设备提供这些功能的Andr​​oid 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

 
精彩推荐
图片推荐