-4

Where does apk files store in android device and how to get list of apk of all installed app

user 1234
  • 11
  • 1
  • 4

1 Answers1

0

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()
    }
Antonis Radz
  • 3,036
  • 1
  • 16
  • 34