RSS

Search Engine

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:

Anonymous said...

Works great; thanks

Anonymous said...

Thanks a lot !

Ademar Oliveira said...

Thanks a lot friend!

Post a Comment