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.package
in above answer need change pInfo to pm
like this
PackageManager pm = getPackageManager(); try { ApplicationInfo ai = pm.getApplicationInfo(, 0); String sourceApk = ai.publicSourceDir; } catch (NameNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); }
this answer by Seth