如何让你的Android应用程序的编译/版本号?
问题描述:
我需要弄清楚如何获得,或使内部版本号为我的Android应用程序。我需要在用户界面中显示版本号。
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.
我必须做一些与的AndroidManifest.xml
?
答
使用:
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
String version = pInfo.versionName;
和您可以通过使用该得到的版本code
And you can get the version code by using this
int verCode = pInfo.versionCode;