Having a PREMIUM and LITE version of a game

Having a PREMIUM and LITE version of a game
0.0 0


I have created a cocos2d-x app and I would like to have a PREMIUM and a LITE version of the game.

What I’ve done is that:
* I’ve made the original app into a library in Eclipse (“TheGame”>“Properties”> “Android”, checked box “Is Library”)
* And then created a normal Android project which uses this library. (“TheLiteVersion“>"Properties”> “Android” > “Libraries”> “Add”)
* I’ve changed the manifest so that it launches the main activity of the Library.

When I run “TheLiteVersion” I get the following error: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2702 (Thread-10073).

Does anyone have an idea why? Or have a better solution for this problem?



My experience with Eclipse is that it’ll go crazy and do the maddest things in the world all on it’s own. I would imagine you’re experiencing one of those crazy moments. My suggestion would be to use one project in Eclipse, and have some code changes/resource filters to swap in and out the required files for the premium/lite versions. My opinion is that it’s just too frustrating to try and do anything complex in Eclipse, so keep it simple and minimise the amount of project setup you need to do.



I’d agree with Ben. Making a whole game into a library looks like a little overkill.


Thanks for your responses!
I got the idea from Androids developer page (http://developer.android.com/google/play/publishing/multiple-apks.html) where they encourage you to make your project into a library.

I how ever solved it by:

  1. Having two different package names, for example: com.example.lite and com.example.premium and in the manifest change them accordingly to the build I wanted.
  2. And in the code check which package I was building:

bool fullBuild = 0 != strcmp(getPackageNameJNI(), "com.example.lite");


I produce several Android native applications this way, having a Free and Elite edition.

In Eclipse, those are two Android projects referencing a library Android project called Core.

In Cocos2d-x I have found that I replace “Core” with my C*+ library and have two Eclipse projects instead of three.
In my case, the Android Library project I previously used is replaced with a C*+ project.