Saturday, January 1, 2011

Take Version of your application In Android Programmatically

Hello Friends,

Today I have discussed about how to see your version number programmatically in android.

This are the simple code developing android application version name.

And this code given below. So see this code.

try {

packageInfo = getPackageManager().getPackageInfo(getPackageName(),0);

strVersionCode = "Version Code: "+ String.valueOf(packageInfo.versionCode);

strVersionName = packageInfo.versionName;

} catch (NameNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

strVersionName = "Cannot load Version!";
}

And this code are very simple code for get version name in android.

I hope this are very helpful code for developing android application.

So enjoyed code.

3 comments:

How to Use Google Lens on Android: Practical Everyday Use Cases

Google Lens is built into most Android phones already, but most people only use it for the occasional plant or object identification. It act...