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 AndroidManifest.xml
?
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 AndroidManifest.xml
?
If you want to use it on xml then add below line on your gradle file:
And then use it on your xml like this:
Use:
And you can get the version code by using this
If you're using the Gradle plugin/Android Studio, as of version 0.7.0, version code and version name are available statically in
BuildConfig
. Make sure you import your app's package, and not anotherBuildConfig
:No Context object needed!
Also make sure to specify them in your
build.gradle
file instead of theAndroidManifest.xml
.