我想创建一个具有以下功能的应用程序.它应该将其.apk文件保存
到SD卡.想象一下,我有一个Button.点击它我必须保存应用程序的.apk文件.
Bas*_* Kh 59
很容易做到这一点..
注意:无需植根.
这是snippt代码:
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> apps = getPackageManager().queryIntentActivities(mainIntent, 0);
for (ResolveInfo info : apps) {
File file = new File(info.activityInfo.applicationInfo.publicSourceDir);
// Copy the .apk file to wherever
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15290 次 |
| 最近记录: |