Answers for "current app version check in android"

0

get app version android

String versionName = context.getPackageManager()
    .getPackageInfo(context.getPackageName(), 0).versionName;
Posted by: Guest on April-16-2020
0

get app version android

PackageManager manager = this.getPackageManager();
PackageInfo info = manager.getPackageInfo(this.getPackageName(), PackageManager.GET_ACTIVITIES);
Toast.makeText(this,
     "PackageName = " + info.packageName + "\nVersionCode = "
       + info.versionCode + "\nVersionName = "
       + info.versionName + "\nPermissions = " + info.permissions, Toast.LENGTH_SHORT).show();
Posted by: Guest on April-16-2020
0

current app version check in android

private String getCurrentVersion(){
PackageManager pm = this.getPackageManager();
PackageInfo pInfo = null;

        try {
            pInfo =  pm.getPackageInfo(this.getPackageName(),0);

        } catch (PackageManager.NameNotFoundException e1) {
            e1.printStackTrace();
        }
        String currentVersion = pInfo.versionName;

        return currentVersion;
    }
Posted by: Guest on February-23-2021

Code answers related to "current app version check in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language