MULTI BANNER MOPUB

Previously I've explained how to insert banner ads mopub into our android project. However, I think it was not a trick or a way that is so special to be posted. So, I added the trick is so special now that probably many who do not know, many who seek it as the title above multiple banner mopub.

To make a lot of ads in the screen is not so difficult, but necessary also foresight and good attention. In order to minimize the time, below we will weaving it briefly, just add a few lines of the previous code on how to enter the ad mopub in android project.



In the hello world project before, we've been able to add mopub banner. Now how do I add multiple banner ads or bring in a single screen.

To add these ads, part of which had been added just in main.xml and mainactivity.java course, following more details.


1. Earlier, on main.xml code just like this

Then we add a way to copy the above code and paste it below the record replace "adlay1" to "adlay2", "adview" was changed to "adview1" and replace "alignParentTop =" true "to" below = "@ + id / adlay1 ". That is adlay 2 will be just below adlay1. So, logic like that, put adlay1 at the top and just below adlay1 adlay2. Then the code entirely in main.xml looks like the picture below.


 2. Previously, MainActivity.java only have a few lines as shown below.


The code below is a complement of main.xml which will bring up two ads on the screen activity on your android. Just copy and paste the code and replace "adview" becomes "adview1" will complete the code to bring up 2 ads in your android screen activity.
If you want to bring up the banner ads as much as 3 or even more, simply copy and paste the code that is in main.xml and MainActivity.java, then replace the name "id" it then you've managed to create applications with multi banner.

For the next post, we will discuss how to add multiple banners admob in android project

Comments