This is useful if a developer wants to install the debug and release version on the same device at same time.
Currently, this is not possible because the package name is hard coded in many places of the application code. I therefore suggest to factor them out or replace them with compile time variables. The following mechanism are useful in this context:
Replace "nl.sogeti.android.gpstracker" with BuildConfig.APPLICATION_ID in .java files.
Replace absolute package names with relative package names in AndroidManifest.xml.
Replace package names with ${applicationId} in AndroidManifest.xml.
Use Gradle buildConfigField "String", "BUILD_TIME", "\"value\""
Add string resource via Gradle resValue "string", "variable_name", "variable_value"
Reference @strings/ in XML files.
The following files are affected (develop branch):
Gradle allows to modify the application id / package name and version name for the debug build:
This is useful if a developer wants to install the debug and release version on the same device at same time.
Currently, this is not possible because the package name is hard coded in many places of the application code. I therefore suggest to factor them out or replace them with compile time variables. The following mechanism are useful in this context:
"nl.sogeti.android.gpstracker"
withBuildConfig.APPLICATION_ID
in .java files.${applicationId}
in AndroidManifest.xml.buildConfigField "String", "BUILD_TIME", "\"value\""
resValue "string", "variable_name", "variable_value"
@strings/
in XML files.The following files are affected (develop branch):
I am interested to hear your thoughts on this issue.