IF you are using gradleGradle you can use the build.gradle file to problematicllyprogrammatically add the value to the xml resources at compile time.
Example Code extracted from: https://medium.com/@manas/manage-your-android-app-s-versioncode-versionname-with-gradle-7f9c5dcf09bf
buildTypes {
debug {
versionNameSuffix ".debug"
resValue "string", "app_version", "${defaultConfig.versionName}${versionNameSuffix}"
}
release {
resValue "string", "app_version", "${defaultConfig.versionName}"
}
}
now use @string/app_version
as needed in XML
It will add .debug
to the version name as describe in the linked article when in debug mode.