Android Studio Tutorials, Admob Banner Ads, Recycler View, Imageview, Gif Imageview, How to Implement Admob Ads, Android Studio Errors, Firebase Database, Get Text from Firebase, Video Status Android Studio

test

Breaking

Post Top Ad

Your Ad Spot

Friday 24 April 2020

Placing Admob Banner Ads in Android Studio | Implementation of Admob Ads in our Android App

When it comes to Android Studio or Android app there must be the need of ads which can give some profit for our work which we spend day night of making and building a Android App. So here is the full tutorial of placing admob banner in 2020 admob and android are regularly changing their dependencies and ad placing ways so this is the latest way for implementing admob banner in android studio.
First we need to add google ads library in our build.gradle file, so just copy and paste that dependency from this link. Now sync your project after that you need to add initialization of admob in your manifest. so just follow the pics and copy that tag which we need to mention in our manifest file. So first of all just open manifest and before application end tag and activity close tag we need to paste this code between these tags.
Like This👇🏼
you can get this code from android developer page from here, just replace that xxx with your admob initialise id if you want to publish app or if you just want to test ad then use google test id.After this open you xml where you want to show banner ad and paster adview layout.

Now Open that xml layout activity and get that adview id in activity by getting variable Adview with findview by id, after this we need to initialise our ad so just type
this code
or you can copy paste from google developer website click here to copy, After this you need to write two line.
code for Admob Banner ad in Java activity

  1. AdRequest adrequest= new AdRequest.Builder.build();
  2. adView.loadAd(adrequest);
So After doing these steps you banner will display in your app you can test in your device.

No comments:

Post a Comment

Post Top Ad

Your Ad Spot