Also Read
Sunday, November 1, 2015

Creating your WebView App : Part 2

9:42 PM

Read : Creating your WebView App : Part 1

After adding the code in activity_main.xml, it may indicate an error. it  is because we didnt mention the string banner_ad_unit_id. 

To mention the ad_unit_id, you need to have an admob account to show advertisements in your app.

  • First Go to
  • Log in to admob using your Google or Gmail account
  • Add your app by Entering the Application name
  • Now you will be asked to create an Ad_unit
  • Create a Banner Ad unit

  • After saving the Banner ad unit, you can see another screen with your ad_unit_id like ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx.

  • Copy the whole Ad unit ID

Come back to Android Studio
Now Go to res>>values>>strings.xml and add the below line in the resources section.

<string name="banner_ad_unit_id">ca-app-pub-xxxx4950339xxxxx/86316xxxxx</string>

Replace the Ad unit ID with yours

Continue Reading : Creating your WebView App : Part 3


Post a Comment

Toggle Footer