How to get app versionCode which is inside app build.gradle
from xml file? I know how to get it from java code, but I need to get it from xml file. Is it possible?
defaultConfig {
applicationId "com.example"
minSdkVersion 15
targetSdkVersion 27
versionCode 47 // I want to access this versionCode
versionName "1.4.2"
multiDexEnabled true
}
I have a file called remote_config_defaults.xml
file under res/xml/
where I increment version code every time manually.
<?xml version="1.0" encoding="utf-8"?>
<!-- START xml_defaults -->
<defaultsMap>
<entry>
<key>APP_VERSION_CODE</key>
<value>47</value> //here I want to get versionCode
</entry>
</defaultsMap>
I use this file for Firebase remote config. I need to access versionCode from this file.