I need to figure out how to get or make a build number for my Android application. I need the build number to display in the UI.
Do I have to do something with
Here is the method for getting the version code:
public String getAppVersion() {
String versionCode = "1.0";
try {
versionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return versionCode;
}