2

I am trying to add Admob in my android application which consists of over 15 activities. My question is which solution is the best one, considering that I can't extend any "BaseActivity" (for various reasons), as presented in this example: Admob on Multiple Activities? and I don't want to violate any agreements regarding rules making adds requests and their use.

So far i've created a file admob.xml containing the com.admob.android.ads.AdView and I use "include layout" in each layout ".xml" file loaded in every activity.

Is this OK? Will I have any problems with Google policies or something like that? Or will this implementation cause me losing potential revenue?

Community
  • 1
  • 1
rrdev
  • 115
  • 1
  • 12

2 Answers2

1

That is a reasonable solution and complies with AdMob policies. Just make sure you don't have two banners on the same page.

Eric Leichtenschlag
  • 8,881
  • 1
  • 28
  • 28
  • Thank you, Eric Leichtenschlag, for the quick answer. I have a follow-up question. I know that there is a minimum limit of the refresh rate imposed by Admob (around 12 seconds I guess), but if the user switches faster between the activities, doesn't it mean that the application is making more requests than it is allowed to? So in this way, the adds are theoretically refreshed faster, thereby that limit seems to be pointless. – rrdev Aug 15 '12 at 10:27
  • 1
    That is correct, it would refresh faster. You could (also not recommended btw) also bypass the refresh limit in the same activity by setting your own timer and calling `adView.loadAd(new AdRequest()` proactively instead of waiting for a refresh. The downsides of having such a short refresh is 1. additional network usage and battery life decrease, 2. decreased CTR which may affect the quality of your site/app. – Eric Leichtenschlag Aug 15 '12 at 20:57
  • The general recommendation is to not place ads on Activities that users spend little time on - like a home screen or an options screen, for example. Also, standard ad refresh times are 30 or 60 seconds. – Eric Leichtenschlag Aug 15 '12 at 20:59
  • @EricLeichtenschlag : Can I use adview in a second activity when the first activity is still not finished(). Both the activities use different layouts. – Ashwin Sep 29 '12 at 10:21
  • Yeah, 1 banner per activity is fine. – Eric Leichtenschlag Oct 01 '12 at 16:54
  • does this means that this approach is wrong: http://stackoverflow.com/questions/41141257/is-it-fine-to-show-an-ad-of-same-ad-unit-id-multiple-times-in-the-same-activit ? – Hammad Nasir Dec 14 '16 at 11:33
1

The Best way is to switch to fragments, Your main application will be in the main fragment, and your ad in the Ad Fragment. This way you can switch your previus activities with fragments, and you will need to initialize the ad Fragment only once, also this will prevent new ad request when you create a new activity (which can lower your admob RPM).

Eli

Eli
  • 707
  • 8
  • 16