Monday, October 26, 2009

[android-developers] Re: Showing application version

Or just use the following code snippet:

/**
* Gets the software version and version name for this application
*/
private void getSoftwareVersion() {
try {
PackageInfo pi = getPackageManager().getPackageInfo
(getPackageName(), 0);
// Store the software version code and version name
somewhere..
Global.softwareVersion = pi.versionCode;
Global.softwareVersionText =
pi.versionName;
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Package name not found", e);
};
}

Good luck good your Android programming! :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate