How to create a “licensing supplement” for my Android application?

I see that some applications on the market come as a free version and a “licensing supplement” where you can use the free version with its limited features or buy an apk license that just acts as a license key for the original “free” version to unlock additional features hidden in the "free" version.

Can someone please give me an example of how this can be done?

+6
source share
2 answers

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

Or, if you need something more complex, you can give the main application and apk license the same user ID in the manifest , This means that both applications can access your data (general settings, SQLite DB, etc.) . Then the licensed application just needs to be run once; it can store a value in shared data indicating that enhanced functionality should be enabled. The main application simply needs to check this flag and change its behavior accordingly.

The advantage of the second approach is that the license application can be deleted after launch, and the main application will continue to provide advanced features.

+4
source

The best approach would be to view billing in the app . This will allow you to have multiple “products” and include features based on which products people bought.

The apk license approach is very simple: you know the apk license package and check if it is installed. If so, suppose they bought it and turned on the pro features. The downside is that it is an application that does nothing, and people need to install it. He also gets his own rating and number of downloads, and probably 1-star comments like “shit does nothing” from people who don’t understand the concept.

+3
source

Source: https://habr.com/ru/post/895524/


All Articles