Get android:versionName manifest element in code

No need to parse the AndroidManifest.xml file for this.

You can get this by using:

try
{
    String app_ver = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
}
catch (NameNotFoundException e)
{
    Log.e(tag, e.getMessage());
}

Use this inside your onCreate() method.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)