Home » Android » android – how to make in-app purchase remove ads

android – how to make in-app purchase remove ads

Posted by: admin June 15, 2020 Leave a comment


I have Android game project and I’m using ad-mob for ads. But, how to make if someone wants to remove ads must pay first.

Can you give me the tutorial, as I’m a newbie in Android and Java

How to&Answers:

You can simply make a button to make in-app purchase in your application. And, once the user presses the button, starts the in-app process, and removes the ads.

Make a flag. It can be in your shared preferences and can be marked true on successful in-app purchase.

Once the purchase is done on all places where the ad is displayed, check the flag, and if it’s false then don’t display ad.

Follow this link:
Integrating Google Play In-app Billing into an Android Application


@LianaRahmadani you can use the following example with android studio, but take care in security java class make the “BuildConfig.DEBUG” with the following formula
“your domain like (com.example).inappbilling.BuildConfig” and it will works with you 🙂