Where does apk files store in android device and how to get list of apk of all installed app
Asked
Active
Viewed 975 times
1 Answers
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
-
And how to get apk from this list – user 1234 Sep 05 '19 at 06:27
-
Sir i am developing a share app in which I want to share app apk so how i will get those app apk – user 1234 Sep 05 '19 at 06:33
-
Above code will only give app name and its image but i want its apk – user 1234 Sep 05 '19 at 06:34
-
you can not get apk file if phone is not rooted. – Antonis Radz Sep 05 '19 at 06:39
-
So how sharing application share apps from one device to another – user 1234 Sep 05 '19 at 06:56
-
Sir if i get root permission of device then how will i get list of apk is there any code available on stack overflow to get list of apk after root permission – user 1234 Sep 05 '19 at 11:02
-
This answer is wrong. You can get the APK for most installed apps without root permissions: https://stackoverflow.com/questions/11012976/how-do-i-get-the-apk-of-an-installed-app-without-root-access – FD_ Sep 18 '19 at 10:39