showing ads in multiple layouts

hello friends,
i have many layouts in my app, so if i want to show ads in my app, do i have to give code in every xml file or is there code which automatically shows the ads in all the layouts.
and what is the correct method to show ads in these types of apps?
like showing different ads in each layout or same ad in all the layout?
pls help…
thank you

I guess it depends. Right now I’m using Leadbolt, and their code automatically tries to fit the screen size. I don’t even have any xml in the layouts file. Admob also had the same functionality, i.e. they resized according to the screen (sadly I was thrown out of Admob, but that is a different story…)

I don’t have experience in this (some here have done this) - but the standard way to make Admob banner ad NOT REFRESH everytime you change activity is to do it using “Fragments”.

That way the Admob banner ad persists while other parts of the layout change. In contrast with move from one Activity to another - different layout XML gets loaded - and if that also has Admob banner ad - then that gets shown again (which MIGHT be bad if you have many fast-changing activities type of thing).

For situation where a single activity is on most of the time - with occasional other - it might be ok to have the Admob banner refresh (for example a game screen and then another settings activity etc.).

But if you are doing traditional layouts - there is not an automatic way (as far as I know) - but the admob banner ad XML will have to be added to each activity’s layout XML file.

here is link to my app
https://play.google.com/store/apps/details?id=com.awlabs&hl=en
pls tell me what will be best monetization solution if i don’t want to use ads…or if i will use ads then interstitial ads can be a good idea…

Use the “fragments” route - search for “fragments banner ad” etc. on stackoverflow or google.

However, you could consider structuring the app so that all the different views are shown in the same activity - you just do View.INVISIBLE or View.GONE on the ones you not want. This would allow you to use the same Admob banner ad view.

You can show interstitials - not sure how well they would be tolerated by users of utility apps etc.

But you can certainly show admob banner ads - just add them to all the layouts (and let it refresh) - if you cannot do the code changes for now. This would be the simplest route to follow for now.

Another thing with revenue is that it seems to depend on how much screen time the user is having with your app - this is an advantage for games etc. which have longer session times - and a slight disadvantage for apps which are utility apps (most extreme case is wallpaper apps).

Since Google is in overdrive mode regarding banning of apps etc. - you should stick to banner and interstitial ads from the mainstream ad networks. If you cannot spend much time on thinking on this you won’t do too much wrong with just going with Admob banner + interstitials.

Try not to show an interstitial more than once per 3 minutes (roughly speaking) - so could show the first one earlier but then second one put some space between them in time etc.

okay, i will go with admob banner and interstitial…thank you…!!..