Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining both free and pro versions of an application

Tags:

I want to create a PRO version of my application for Android and was wondering how to structure my repository.

For know I have a trunk and feature branches. I'd like to put a pro version in another branch but maybe there is a better way? For example, maybe I should create two branches - one for free version, the other for pro?

Pro version will have additional features and will be ads-free, so eg. I don't want to include AdMob libraries in the pro version.

Do you have any experience or suggestions as to what would be the best way to structure the repository in this case?

EDIT: I think I've found the best solution (for my app) in this thread: http://groups.google.com/group/android-developers/browse_thread/thread/4ad3d67f735f16d7/948b4f9eee2490a3

The trick discussed there is about having another application that only serves the purpose of unlocking PRO functionality in the actual application. The unlocking app is paid in the market and the actual app merely checks for the existence of it on the device.

like image 431
Marek Stój Avatar asked Mar 27 '10 11:03

Marek Stój


1 Answers

I know you have already made your decision, but I have another suggestion that might help others.

I use git for my repository. Creating and maintaining branches is very easy. I have my master "pro" repository, and a "free" branch. I make all code changes to the master. My "free" branch only differs by whatever changes trigger the "free" behavior. Whenever I'm done making changes to the code, I commit it to the master branch, then switch over to the free branch and use the "rebase" command to catch it up with the master.

It rolls back the change that makes it behave as the "free" version, applies the changes I made to master, then re-applies the "free" changes.

I don't have to maintain two versions. I don't have to remember to toggle some switch, or make the same changes back and forth. It's pretty slick, and I like it better than a second app that triggers the pro behavior because I can strip out libraries that aren't needed for the version in question.

like image 132
BenTobin Avatar answered Sep 20 '22 07:09

BenTobin