Skip to content

Instantly share code, notes, and snippets.

@sunwicked
Last active December 18, 2015 04:39
Show Gist options
  • Save sunwicked/5727271 to your computer and use it in GitHub Desktop.
Save sunwicked/5727271 to your computer and use it in GitHub Desktop.
Finding out an Android apk's details: package name, version code, version name .. etc.
/**
* Used to find details of an apk file placed on the
* device, requirements are location of the file.
* PackageInfo gives details like package name, version code, version name .. etc
**/
String srcApk = Environment.getExternalStorageDirectory()+"/your.apk";
PackageInfo pf = getPackageManager().getPackageArchiveInfo(srcApk, PackageManager.GET_META_DATA);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment