How to Use the Paid Version of My App as a "Key" to the Free Version

Change a Paid Android app to a Free app with in-app purchasing

It's been a year, so the OP probably doesn't need this, but in case anyone else happens upon this one...

You could approach this a couple of ways. Obviously there is some business logic on your new in-app purchasing app to track who has/hasn't paid. So the two ways I see you being able to go about this is as follows:

Idea 1:

You could do a preliminary update to your paid app that stores a SharedPreference or some other persistence in the app (you could store the versionCode, so you know what you're upgrading from and have business logic around that). Then update to the free version, and have the free version check your shared preference and do the right thing on an update from a "paid" versionCode.

Idea 2:

You could keep both apps separate (have a paid version and a free with in-app purchases) and push an update to the paid version to have a BroadcastReceiver that doesn't really do anything other than listen to specific intents and have your in-app purchase check to see if something will receiver your custom intent. If your old paid-version exists, then they paid for it, if not they didn't. (If they paid for the paid version then uninstalled you'll have problems obviously...)

Idea 3:

You could keep both apps separate (have a paid version and a free with in-app purchases), and push an update to the paid version that just posts an Intent to open the in-app purchase app (if it's installed) with some special arguments, to let you know they opened it via a paid app and do the right thing to set them up as having paid for it in-app. That opens yourself up to some detection problems though... (Solvable but kind of clunky)

Is it possible to replace an existing Android free app with its paid version

You can not, and should not replace your free app with the paid version.

Unless you do a in-app to unlock the free app, the best practice seems to be to create a "key" app which unlocks the functionality in the free app. This key app can be hidden from the app drawer, which should prevent the annoyance usually associated with having two apps.

Another benefit of this is that all user data remains within the free app, and once the user upgrades to pro, you do not have to take any further steps to move the data from free to pro. Also, even if the user uninstalls the pro key app, the data will still remain in the free app.

Take a look at this answer for the simplest way to do the check for a key app from your free app - there are many ways to do it, this is just a basic example.

Merging a paid Android app with the free version

However, I obviously don't want to upset my users who have already bought the paid app.

Unless you are charging less for the IAP than for the paid app to get the same features, I'm not sure how this would lead to any user complaints. Whether they paid up front or later, if it's the same price it shouldn't matter.

I'm considering a solution I came up with which would have the free version automatically unlock its paid features if it detects that the paid version of the app is installed on the device.

This can be done pretty easily just by querying PackageManager to see if the other app is installed. Something like:

try {
PackageInfo info = getPackageManager().getPackageInfo("com.example.paidapp", 0);

//If we got here, the paid app is installed.
// You can even check metadata, like which version they have
int installedVersion = info.versionCode;
} catch (PackageManager.NameNotFoundException e) {
//Paid app is not installed!
}

Some apps have done this for various reasons, using the "paid" package as a key into the free application, so it's not without precedent.

The only IPC you might need to get involved in would be if you want to somehow read some saved data out of the paid app into the free app. In this case, I would suggest implementing a ContentProvider to expose the data elements you need to the other application. I would also protect that provider with a signature permission, so that only your applications can access it.

Can my free Android app be upgraded to a paid version via in-app purchase AND paid store version?

I see three solutions.

  1. Add In-app purchase
  2. Add new app "Your app name pro unlocker"
  3. Add new pro version of you app

I think that the first one is the most reliable and easy to achieve. It is harder to crack by pirates too. Pirates can upload your app to their sited but when user will download it he will get normal free version. Of course anything can be hacked ;-) but... it is better than 3rd option (see below).

Second one - in you main app you need to check if "pro unlocker" is installed, maybe you will need to check if certificates are the same and run, custom implemented, android service in this to check if use is allowed to use pro version. It is quite ok and beacuse you will use a quite lot of custom coding it should be safe.

Third - using Grandle you can simply create second version of your app, during building Grandle will create pro/free version automatically. However pro versions which are using Google Licensing are easy to crack by pirates so...

To sum up - you have 3 three solutions. I think that the first one is good enough and it is not requiring too much code or time for maintaining. I hope that this will help you ;-)

Cheers

How to handle application upgrades from free to paid version while preserving any data

The answer is: this is not solvable with Android Market, because Market does not allow the upload of two apps with the same package name. Android cannot be tricked into installing the premium version over the free version and treat it as an upgrade.

The good news: adding database backup/restore functionality (copying the database to the SD card and back to the app folder) only required a few lines of code. My users will have to install both versions in parallel, back up the database from the free version and restore it to the premium version.



Related Topics



Leave a reply



Submit