Adding ad banners into you app
To monetize your app you can add advertisements and earn revenues based on viewers visiting the ads. You'll see below how easily you can add advertisement banners through Admob. Admobs is a Google acquired company and is one of the largest advertisement platforms with over 40 billion advertisement banners. It offers monetizing and promotion of your app. Admobs support many mobile platforms like android, IOS, webOS, Flash Lite, Windows Phone and all standard mobile browsers.
This is the best practices to show your ads.
follow the steps given below-
In your Android studio project :
Download google repository in your SDK which is present in the extras section.
Add dependency into Application level build.gradle file (There is a project level and a application level build.gradle file) : com.google.android.gms:play-services:6.+
your dependencies will resemble like this:
Now click on Monetize new App and follow the instructions . They will ask your project or aplication name . And you can customize the advertisement type as per your needs .
Finally, a new ad unit id will be generated .
Replace the value of the string banner_ad_unit_id with that value.
Run the application again. And you can analyse your ad views in your AdMob account.