How to get the android version name from Manifest?

My question is as the title, how can I get the android version name from the Manifest?

Thanks.

FaRHaN

anybody know how to get the version name from manifest?

i did some googling and I found this

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

I added it in the java code main activity but getPackageManager doesn’t exist.
I wonder if getPackageManager is from the old versions.

I hope somebody can help me.

http://developer.android.com/reference/android/content/Context.html#getPackageManager()

Thanks.
Actually the sample code I posted works. Not sure why it didn’t work before (probably because I need some rest first LOL)
Anyway, thanks for the link :slight_smile:

Dawid Drozd wrote:

http://developer.android.com/reference/android/content/Context.html#getPackageManager()