We will be continuing our journey into App versioning, this time for Android. Similar to iOS, in Android, we have to create Compiler symbols too. For those who have missed iOS versioning blog, click on below is the link.
Versioning of iOS app (Dev, Stage, and Prod) using same code base – Xamarin Forms
Set different configurations
Similar to iOS, setup all the required configurations as shown below,
Compiler symbols options
Double-clicking on Android project should prompt with Project Options, go to compiler tab under Build section. Here similar to iOS add symbols Dev, Stage, and Prod.
Android Manifest file
In case of Android, we need to create new Manifest files to support creating different apps. Two things to change in this file are package and android: label, as shown below for Dev.
Edit Android Proj file
Now we have to assign in proj file to set each environment with the correct android manifest file, as shown below.
Open proj file using the path
Now change each configuration setting as shown below with the correct Android settings with appropriate Android Manifest file.
Remove Label from the main activity, so the app picks up the name from required Android Manifest file.
When we run with above configurations, it will create different apps for the same code base
Leave a Reply