/**
* Get current version number.
*
* @return
*/
private String getVersionNumber() {
String version = "?";
try {
PackageInfo pi =
getPackageManager().getPackageInfo(getPackageName(), 0);
version = pi.versionName;
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Package name not found", e);
};
return version;
}
Peli
www.openintents.org
On Oct 27, 8:36 am, Selmi <[EMAIL PROTECTED]> wrote:
> how can i read current application version? i mean value stored in
> manifest file for android:versionCode and android:versionName
>
> so far i tried to find some api for it in Application or Context, but
> i didn't found any. also i didn't found it in android.R. resource
> identifier (or in R.) so i don't know what to try next....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---