SHARE
Facebook X Pinterest WhatsApp

Monetize Your Free Android App by Creating a Paid App to Unlock Additional Features

There are several different methods of monetizing Android apps including ads, pay services as well as a paid version of the app itself. Often there is a need to create a lite version of your application, which includes reduced functionality and/or ads. Depending on the design of your application it may be possible for a […]

Written By
thumbnail
CodeGuru Staff
CodeGuru Staff
Nov 4, 2011
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

There are several different methods of monetizing Android apps including ads,
pay services as well as a paid version of the app itself. Often there is a need
to create a lite version of your application, which includes reduced
functionality and/or ads. Depending on the design of your application it may be
possible for a user to purchase the paid version and uninstall the lite
version. However, if your app includes local databases, preferences and/or
local files, which must be retained, then you would not want the user to
uninstall the lite version as it would wipe out their information. Thus you
would want to provide the user with the ability to purchase a paid version that
would unlock additional features in the free version.

At a basic level, your free application would need to direct the user to the
paid version in the Android Market whenever the user tries to access a feature that
is unlocked by the paid app. The following code snippet demonstrates one method
for directing the user to the paid application.

Intent goToMarket = null;
goToMarket = new
Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.my.paid.packagename"));
startActivity(goToMarket);

An important item to note within the Intent is the market:// URI. The
package id used in the URI is case sensitive so this Intent will only work if
it is an exact match for your paid package id. Next, your free application will
need to detect the presence of the paid app and allow the user to access the
appropriate functions. There are several different ways to accomplish this with
varying levels of complexity. The simplest method is to look through the list
of installed applications for one that matches your paid version. Here is an
example method that allows you to do just that.

public static final boolean IsPaidVersionInstalled(Context ctx)
 {
 String PaidPackageName = "com.my.paid.packagename";

 //Grab the Installed Application Info to try to find the one we are looking for
 List list = ctx.getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA);

 //Loop through the packages and make sure the donate package is actually installed
 int i = 0;

 for (i=0 ; i {
 ApplicationInfo ai = list.get(i);

 if (ai.packageName.equals(PaidPackageName))
 {
 return true;
 }
 }

 return false;
 }

This method, IsPaidVersionInstalled, first pulls back a list of installed
applications and loops through the list looking for the package id of the paid
app. Thus you could use this method to determine if the user purchased the paid
version and if not, display a pop up message and send them to the Market to
purchase it.

Conclusion

The above code blocks provide you with the ability to detect the presence
of a paid version and/or send the user to the Market to purchase it if desired.
This approach is simple to understand; however, it does have a flaw. Simply
detecting the presence of a paid version does not guarantee it is the paid app
you created. Someone could create a dummy app with the identical package name
and install it manually on to their devices. While this is fairly unlikely it
is recommended to add a second factor for verifying the creator of the paid
application. There are a couple of methods for accomplishing this such as
creating a custom provider within your paid app, then build code within the free
version, which would periodically query the provider. In any case, adding the
ability for a free app to detect a paid version is a simple process, which can
drastically increase the ability to monetize your app.

Android Development Tools Section Index

Recommended for you...

Video Game Careers Overview
CodeGuru Staff
Sep 18, 2022
Dealing with non-CLS Exceptions in .NET
Hannes DuPreez
Aug 5, 2022
Online Courses to Learn Video Game Development
Ronnie Payne
Jul 8, 2022
Best Online Courses to Learn C++
CodeGuru Staff
Jun 25, 2022
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.