Protecting the content

When an app is published on Google Play, anyone can download and install it. This is great when the user has purchased the app. However, we need a way to prevent users from accessing the app if they have managed to get hold of the app without purchasing it.

Getting ready

Before we can add licensing to our app, we will need the app's public key from the Play Store app listing, which is created on the Google Play Developer Console (https://play.google.com/apps/publish).

How to do it...

One of the ways to prevent unauthorized access to our app's content is by adding Google Play licensing to our app. Then, when the app is launched, we can verify the user with Google Play.

The first thing that we will need to do before adding licensing ...

Get Xamarin Mobile Development for Android Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.