Tuesday, March 31, 2015

Two apps, same functionality but different branding? (Product Flavors?)

I'm still trying to come up with a perfect solution.


The biggest issue is all the image assets (e.g. the tile icon, etc.). I haven't figured out a way to dynamically change the tile and store images or app package name. To overcome this I am using a mostly empty project that contains all that stuff and just calls a separate main project and passes along an object containing the other branding details (colour scheme, app name, etc.).


So my apps have a branded project and a main project. You can build the main project separately and add a reference to it to your main solution (which contains only the branded components and no actual code or pages).


In a sense the branded project serves as a 'head' to your app. It's essentially empty.


I have no experience with pre-build steps, but you should be able to swap out the tile images. I will look into that myself as it may be a more elegant solution than what I'm using.


You could set up conditionali compiling (you need to create different compile options like 'ReleaseBrandA', then in your code you can do this:


#if ReleaseBrandA


// brand A specific code


#endif


If you build your app with enough foresight you can probably avoid that by keeping any brand-specific code in the branded project.




I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.


No comments:

Post a Comment