Focus on technology, enjoy life! --Yang Zhou qq:804212028
original link: http://blog.csdn.net/y18334702058/article/details/44624305
This article may exist the reference or the use of some external resources, if there is any infringement, please contact me!
- Topic: Software Installation and uninstall source code
Installing software from SDcard:
String fileName = Environment.getExternalStorageDirectory() "/myApp.apk";Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse("file://" + filePath), "application/vnd.android.package-archive");
or with
/**intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive");*/startActivity(intent);
Uninstalling software
Uri packageURI = Uri.parse("package:com.android.myapp");Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);startActivity(uninstallIntent);
Focus on technology, enjoy life! --Yang Zhou qq:804212028
Original link: http://blog.csdn.net/y18334702058/article/details/44624305
Step by Step _android Development Course _ Foreign Chapter [5]_ Software Installation and unloading source code