Skip to content

Instantly share code, notes, and snippets.

@jschmid
Created February 11, 2013 18:27
Show Gist options
  • Save jschmid/4756433 to your computer and use it in GitHub Desktop.
Save jschmid/4756433 to your computer and use it in GitHub Desktop.
Get android version code and version name
PackageManager manager = this.getPackageManager();
PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
Toast.makeText(this,
"PackageName = " + info.packageName + "\nVersionCode = "
+ info.versionCode + "\nVersionName = "
+ info.versionName + "\nPermissions = " + info.permissions, Toast.LENGTH_SHORT).show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment