Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a "Licensing add-on" for my Android application?

Tags:

android

apk

I see that some apps on the market come as a Free version, and a "Licensing add-on", where you can use the Free version with its limited features, or buy the license apk which just acts as a license key for the originally "Free" version, to unlock extra features hidden within the "free" version.

Can someone point me to an example of how this can be done?

like image 735
92Jacko Avatar asked Aug 21 '11 09:08

92Jacko


Video Answer


2 Answers

You can use the PackageManager's getInstalledPackages() or getInstalledApplications() to simply check if the license package is installed.

Or, if you want something a bit more sophisticated, you can give the main app and the license apk the same user id in the manifest. This means that both apps can have access to your data (Shared Preferences, SQLite DB, etc). Then the license app just needs to be run once; it can store a value in the shared data indicating that the extended functionality should be enabled. The main app just needs to check this flag and alter its behaviour accordingly.

The advantage of the second approach is that the license app can be uninstalled after being run, and the main app will continue to allow the extended functionality.

like image 129
Graham Borland Avatar answered Nov 15 '22 11:11

Graham Borland


A better approach might be to look at in-app billing. That would allow you to have multiple 'products' and enable features based on what products people have bought.

The license apk approach is very simple: you know the package of the license apk and check if it is installed. If it is, you assume they have bought it, and enable 'pro' features. The disadvantage is that it is essentially an app that does nothing, and people have to keep it installed. It also gets its own rating and download count, and probably 1-star comments like 'crap, does nothing' from people who don't understand the concept.

like image 38
Nikolay Elenkov Avatar answered Nov 15 '22 11:11

Nikolay Elenkov