main:
PackageInfo manager = ggetPackageManager().getPackageInfo(getPackageName(), 0);
Log.d(TAG, "Version Code = " + getVersionCode(manager));
Log.d(TAG, "Version Name = " + getVersionName(manager));
/*
* get Version code
*
* @para PackageInfo manager = ggetPackageManager().getPackageInfo(getPackageName(), 0);
*/
public static int getVersionCode(PackageInfo manager){
int verCode= 0;
verCode = manager.versionCode;
return verCode;
}
/*
* get Version name
*
* @para PackageInfo manager = ggetPackageManager().getPackageInfo(getPackageName(), 0);
*/
public static String getVersionName(PackageInfo manager){
String verName = "";
verName = manager.versionName;
return verName;
}
No comments:
Post a Comment