apk文件在android设备中存储在哪里以及如何获取所有已安装应用程序的apk列表
You can not get apk file without root permission and if you would share APK file would not be good idea because of security issues.
Only good practice option is get app id and then generate Intent link to App store
with specific package name using App linking
like you are doing when want to start app from browser. something similar is here App opening from browser
And here is how you can get installed apps list
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> appList = context.getPackageManager().queryIntentActivities( intent, 0);
sharing might also look like this:
fun shareApp(appId: String, activity: Activity) {
ShareCompat.IntentBuilder.from(activity)
.setType("text/plain")
.setChooserTitle("Share app")
.setText("http://play.google.com/store/apps/details?id=" + appId)
.startChooser()
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.