mars

HOW TO MAKE MONEY IN APP/Admob-Banners and Interstitial ads

  In this tutorial we are going to learn how to create Admob ad placements and implement ads in project.

Let's begin, open admob website Here

Now click on the Menu button.

\
Then select Apps.

Now select add new app. Choose android as platform. 

Choose whether your app is already in playstore or not. If you select yes, you will be required to paste the apps playstore link .

Choose your option and continue. Then select create ad unit.












We begin with Banner. Select banner. 











Enter ad name (any name-you should remember). Then click Create Ad Unit.


Now Banner ad unit is successfully created. Next let's create Interstitial ad unit. Select Create Another Ad Unit.
Choose Interstitial.


Repeat procedure - give ad name and select Create Ad Unit.

Now both your Banner and Interstitial ad units are ready.

Select done 

Copy the ad units and save them somewhere. You will need to paste them in your app project later.




Now it's time to implement in the app project. Open your project. 

Enable admob. Go to library.



Select admob.

Turn on the switch on the top right.


Add the units you made in Admob website with the names you gave. Add Banner and it's ad unit then add Interstitial and it's ad unit.



After adding both ads placements (banner and Interstitial), click next in the top right corner.

Now select ads in relation to title.



After selecting. Click next in top right corner. Now add your device as test device then click next in the top right corner.

Save settings.


Go back to layout editor.

Add a linear H (horizonal) and place your banner inside the linear.

Now go to onCreate activity event. Open it, initialize and load the banner ad.



We are done with banners. Let's proceed to setting up Interstitial ads.

Go to components, then add Interstitial ads component. Name it anything you like.

INTERSTITIAL
Let's go back to onCreate event. Here we will initialize the ad and load it.

The final step is to find an ideal situation where we will show the loaded Interstitial.

"Bad location of your ad show logic can lead to Google taking action against your account e.g showing Interstitial ad in onCreate is not allowed".

In this tutorial, we will add the show Interstitial ad in onDownloadSuccess. You can add it anywhere else ideal. (Read more about does and dont's of admob online if you need for knowledge on where to put your ads).


We are done, now compile your projects and ads will show.

Post a Comment

0 Comments