Created
August 28, 2012 07:30
-
-
Save billynyh/3495860 to your computer and use it in GitHub Desktop.
read android app meta-data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get meta-data from AndroidManifest.xml | |
ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); | |
String meta = ai.metaData.getString("key"); | |
// get version name and version code | |
PackageInfo pinfo = getPackageManager().getPackageInfo(getPackageName(), 0); | |
String versionName = pinfo.versionName; | |
int versionCode = pinfo.versionCode; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment