In this post, I will show you how to add Admob Native Ads in Android App. Admob Native Ads are the new type of ads served by Admob apart from banner and Interstitial ads which are most popular ad servings by Admob.

Watch video for better understaing and to know how to get admob native ads id from admob

Procedure:

Below is the screenshot which shows an Android ListView with some Names and their Profession.

listView

 

  • Now I will add an Admob Native Ads as a third item in the ListView. You can add anywhere in your app
  • For that, You need to add below line to your build.gradle file under dependencies. Which will add Firebase ads Library to your project

 

  • Now add below line to build.gradle (Project) in dependencies

  • Now Sync the project.
  • After the project is successfully loaded add below NativeExpressAdView to your activity layout in my case I am Adding to activity_main.xml

  • Now add below line to your strings.xml file

  • Above Id is Admob Test ID for Native Ads. If you want to know know how to get Real ID you can watch Video Here
  • Next in MainActivity.java add below variables above onCreate() Method.

  • Next, add below code in onCreare() method.

  • If you see any Red text just click on them and press Alt+Enter on your Keyboard which will import them.
  • Now run the code on your device or emulator you should see Admob Native Ads like below Screenshot
Admob Native Ads
Admob Native Ads