Is there any way to know dynamically and programmatically the versionCode of an Android application??
I don´t know... maybe something like
getApplicationContext.getVersionCode();
Thank you very much.
Is there any way to know dynamically and programmatically the versionCode of an Android application??
I don´t know... maybe something like
getApplicationContext.getVersionCode();
Thank you very much.
You find the following from using this code
public int getVersionCode() {
int v = 0;
try {
v = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
} catch (NameNotFoundException e) {
}
return v;
}
Class Required
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;