Sameer M

Sameer M

  • NA
  • 19
  • 2.4k

Making 2 versions of android app by reusing code, resource

Aug 15 2017 8:27 AM

Using Visual Studio 2017.

I have a flat solution (called NW) with a single project called NW. The output is an apk named NW.apk which is aimed at users from multiple countries - US, UK, Canada, etc.
I would now like to be able to make 2-3 different versions of my app NW, something like NW USA, NW UK, etc.
My main objective here is to be able to generate apk's with different package names and different app icons.
 

I've been thinking about what is a minimal maintenance solution as future development happens, with which I can add new drawables, resources, etc to NW. Then based on some flags, either in config or in code or some other technique I'm hoping will be suggested here, I simply build NW_USA, NW_UK, etc and I have all the apk's which I want, each functioning like a standalone subset of my original NW app.

Reusing my .cs files is straightforward as they can be added into additional projects. However, I'm struggling to figure out how to make this happen so I don't have to make changes like adding drawables and add strings to my .resx files, etc to each version.

Inputs appreciated.


Answers (1)