Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In-App Purchase remove ads

Tags:

android

sdk

I have implemented ads in one of my apps and I want to make a in-app purchase feature to remove them. How would I do this.

I was thinking a simple way, was to hide the ads by making in invisible, after purchase. Could that work or is there an easier/better way?

I have no idea how to use the in-app feature for any purpose. Could anyone show me the way to code or something to read on this?

like image 399
MoschDev Avatar asked Nov 10 '12 14:11

MoschDev


People also ask

How do I get rid of in-app purchase ads?

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.

Do people pay to remove ads?

Google is now letting Web users pay a monthly fee to remove ads from sites. The subscription service, called Google Contributor, asks users to pay $1 to $3 a month to remove advertising from partner sites on both desktop and mobile.


2 Answers

It depends on how you inserted the ads in the first place. If you did it via code, then just put an if(removed ads == false) around the code that inserts ads.

If you did it via XML, then the best way to do it is to copy out your XML, without the adview, and in your code use if surrounding all of your setContentView(R.layout.example)

Here's an example of what I mean

if (adsDisabled == true){     setContentView(R.layout.mainNoAds) } else{     setContentView(R.layout.main } 

In-app purchases -

http://developer.android.com/guide/google/play/billing/billing_overview.html

In this post I assumed you are using admob, but the same should be true for all companies

On last thing - using adView.View.GONE IS bad practice **DO NOT ** do that

like image 59
jcw Avatar answered Oct 27 '22 00:10

jcw


I haven't tested this, yet.

It looks like you can also completely remove the view:

Correctly disable AdMob ads

like image 22
jnrcorp Avatar answered Oct 26 '22 23:10

jnrcorp