896+ Capstone Project is Available: Whatsapp: +91-7011258995, Email: sharecodepoint@gmail.com

How to add admob ads in android app - Mobile app monetization the smart way

AdMob helps app developers monetize their mobile apps by showing ads in their mobile apps. - Admob.

How to generate Ads for Android apps !

How to monetize your android application using AdMob.

AdMob is a mobile ad network from google.

In this tutorial i will show you how to place AdMob simple banner ad in your android application.

What is Admob ?
adMob can be used for Android and iOS apps... Full Details

Step 1 : Add complie line to build.gradle
Go to > build.gradle (Module: app) 
compile 'com.google.firebase:firebase-ads:10.0.1' 

compile 'com.google.android.gms:play-services-ads:10.0.1'

Step 2 : Add string to string.xml
Even resource part-system glitch.
<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>

Step 3 : Add xmlns to main_activity.xml
    ads:adUnitId="ca-app-pub-3940256099942544/6300978111" >

Step 4 : Import class into MainActivity.java
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

AdView adView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder()

Step 5 : Add user permission to AndroidMainfest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

That's it! To place AdMob simple banner ad in your android application. Thanks for reading!

 If you have any doubt regarding the tutorial then leave your doubts in the comment box.


Sharecodepoint is the junction where every essential thing is shared for college students in the well-defined packets of codes. We are focused on providing you the best material package like Question papers, MCQ'S, and one NIGHT STUDY MATERIAL. facebook twitter youtube instagram

Post a Comment

Previous Post Next Post

Contact Form