Search code examples
androidapk

How can i get the apk file name and path programmatically?


I want to get the exact file name of a program if I already know the package name of the target apk. For instance, if I know the package name of my apk, which is com.packagename, how can I get the exact path and file name of that package? Btw, i don't want to get just MY apk location, i want the location of any package name i apply. SystemTuner pro is able to do this so i know it is possible, just not sure how.

Thanks guys!


Solution

  • PackageManager.getPackageInfo() returns information about the package, and PackageInfo.applicationInfo field has required information about the application.