Learn How To Place Admob Banner Ads And Interstitial Ads In Your Android Application | Android Studio.Tutorial For Beginners

  • The Android Studio tutorial is designed to show "How to Place
    Banner Ads and Interstitial Ads in your Android Application if you
    are looking to earn revenue from your apps.

  • In this tutorial, you will see implementation of Banner and
    Interstitial Ads where we’ll be using Google Admob Test App Id,
    Test Banner Id and Test Interstitial Id. You can get the sample Id
    here - https://developers.google.com/admob/android/test-ads

  • Go to this link to generate ur app id and unit id
    https://admob.google.com/home/
    (i) Create a new App by giving the package name of the app you
    want to integrate AdMob.
    (ii) When the App is created, you can find APP ID on the
    dashboard whose format is like ca-app-pub-
    XXXXXXXXX~XXXXXXXXX.
    (iii) Select the newly created App and click on Add Ad Unit
    button to create a new ad unit for your ads.
    (iv) Select ad format and write a name for ad unit.
    (v) Your Ad unit will have format like this- ca-app-pub-
    066XXXXXXX/XXXXXXXXXXX

  1. Once the ad unit is created, you can notice the Ad unit ID on the dashboard. An example of ad unit id look like ca-app-pub-066XXXXXXX/XXXXXXXXXXX
  • This project is very simple to implement and has very simple
    steps:
  1. Add Gradle dependency in Build.Gradle (App)
  2. Add Adview in Activity_main.xml file
  3. Also add AdUnit Id and Adsize (refer the tutorial carefully)
  4. Put all your Id in String.xml file.
  5. Create a class and extend with Application class, Inside
    onCreate function Just initialize your admob app id.
  6. In MainActivity.java file, create AdRequest and pass the adview.
  7. Interstitial ads doesn’t require any view to be added in its xml
    layout. Just modify the MainActivity class as shown in the
    tutorial and don’t forget to add listener ( we need to specify some
    event to display interstitial ads )

#android

Create Admob Ads In Android Studio | Android App Development Tutorial
1.65 GEEK