在应用程序内购买移除广告移除、应用程序、广告

2023-09-12 23:05:25 作者:kitty

我已经在我的应用程序之一实现的广告,我希望做一个在应用程序内购买功能将其删除。我将如何做到这一点。

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?

我不知道如何使用在应用程序的功能用于任何目的。谁能告诉我怎么到code或东西来阅读?

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?

推荐答案

这要看你摆在首位插入广告。如果通过code做到了,那么只要把如果(去除广告== FALSE)围绕code中插入广告。

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.

如果您通过XML做到了,那么要做到这一点是复制了你的XML,没有AD浏览报,并在code使用的最好的方式,如果周围所有的的setContentView(R的.layout.example)

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)

这里是我的意思的例子

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

在本文中,我假设你正在使用AdMob的,但同样应该适用于所有的公司

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

在过去的事情 - 使用 adView.View.GONE 是不好的做法,**不要**做

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