Android APK Version Get getAppVersion(Context context)

Here you can find the source of getAppVersion(Context context)

Description

get App Version

Declaration

public static String getAppVersion(Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;

public class Main {
    public static String getAppVersion(Context context) {
        try {/* w w  w .j  a va  2  s .  co  m*/
            return context.getPackageManager().getPackageInfo(
                    context.getPackageName(), 0).versionName;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. getApplicationVersion(Context ctx)
  2. getFirstInstalled()
  3. getVersion(Context context)
  4. getVersionCode(Context context)
  5. GetVersion(Context context)