best practices for handling multiple Android OS version and multiple versions of my app

RainerMagerRainerMager JPMember ✭✭

I have a game that exists in two versions, the paid version and the free-with-ads version. I also am trying to support two major versions of Android, 2.3+ and 4.4+. My code for all of these combinations if almost identical with a few small changes that I'm handling with #if statements and compile-time symbols.

To do all this I've created separate project files for each version, although they all exist in the same folder. I set the appropriate symbols in the project files (and don't include the GooglePlay reference for the paid version). Also, for the two different Android versions I need to have different Android Manifest files, so I have <AndroidManifest>Properties\AndroidManifest.2.3.xml</AndroidManifest> lines in my project files.

This generally works, but it does have a number of headaches:

  1. the compiles of each of these projects conflict because the use the same obj directory
  2. to get around that I've been unloading all but one project while I work on it, this is annoying
  3. when I switch projects I always must remember to do a clean build or else artifacts of the previous one break the build
  4. when I add new files to my project I need to add it to each of these separately

Does anyone do anything similar or have any hints or tips to make this less painful?

Sign In or Register to comment.