Android Utililty Methods APK Version Get

List of utility methods to do APK Version Get

Description

The list of methods to do APK Version Get are organized into topic(s).

Method

StringGetVersion(Context context)
Get Version
try {
    PackageInfo manager = context.getPackageManager()
            .getPackageInfo(context.getPackageName(), 0);
    return manager.versionName;
} catch (NameNotFoundException e) {
    return "Unknown";
StringgetAppVersion(Context context)
get App Version
try {
    return context.getPackageManager().getPackageInfo(
            context.getPackageName(), 0).versionName;
} catch (Exception e) {
    throw new RuntimeException(e);