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 to our app is to get the app's public key from Google Play:
- We need to copy the Base64-encoded public key from the console under the app's Services & APIs section:
- Then, we will paste that key into...