In Previous posts I showed you how to implement Admob Banner Ad & Interstitial Ad to your Android application individually. Now i will show you How to implement both Admob Banner Ad and Interstitial Ad combined to your Android Application.

Also Read:

Android working with AdMob Interstitial Ad

Android working with AdMob Banner Ad

Procedure:

  • Create a new project or open your existing Android project in Android Studio 
  • Then ad below line of code in build.gradle inside your dependencies and sync project before proceeding further

  • Now open your activity layout and add below lines of code. In my case I am pasting it in activity_main.xml file.

 

  • Open MainActivity.java file  and add below two lines to your main class.

  • Now add below lines to your onCreate method in MainActivity.java file.

  • Add below method to your MainActivity.java file. If you don’t know exactly where to add code just paste above last curly bracket in the code or watch video embedded above.

  • Now add below to lines to your strings.xml 

 

Note: Admob ad ids i am using here are test ad ids, you can get working ad ids from you Admob account.

  • Now run the application and test your self on AVD or Android device, you will get both Admob Banner ad & Admob Interstitial Ad

Also Read:

How to show Admob Interstitial Ad After preset time

Click On below Link to get Source Code

[ihc-hide-content ihc_mb_type=”show” ihc_mb_who=”reg” ihc_mb_template=”1″ ]Download[/ihc-hide-content]