Hi,
i have an option in my app the lets the user to share the app with others, but the problem is that i don't know how to get the apk path of my app.
found this (with shell) :
with shell i can get the path with this command :
adb shell pm path com.xxx.yyyyyy
the result is something like this :
package:/data/app/com.xxx.yyyyyy-115.apk
and this code :
but i don't know how to get the sourceDir with applicationmanager.
any help is appreciated.
i have an option in my app the lets the user to share the app with others, but the problem is that i don't know how to get the apk path of my app.
found this (with shell) :
B4X:
http://stackoverflow.com/questions/11012976/get-apk-of-installed-app
with shell i can get the path with this command :
adb shell pm path com.xxx.yyyyyy
the result is something like this :
package:/data/app/com.xxx.yyyyyy-115.apk
and this code :
B4X:
final PackageManager pm = getPackageManager();
//get a list of installed apps.
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages) {
Log.d(TAG, "Installed package :" + packageInfo.packageName);
Log.d(TAG, "Apk file path:" + packageInfo.sourceDir);
}
but i don't know how to get the sourceDir with applicationmanager.
any help is appreciated.