Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9100093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:46:56+00:00 2026-06-17T00:46:56+00:00

I have followed a few tutorials / stackoverflow threads to learn how to add

  • 0

I have followed a few tutorials / stackoverflow threads to learn how to add an Admob banner to the bottom of my UI.

I have added the adMob sdk to the lib, added the following to the XML for the UI that I want to show the ad on

<RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"     
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:background="#000000">      


<com.google.ads.AdView 
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:id="@+id/adMob"
  android:layout_alignParentBottom="true"
  ads:adUnitId="YOUR AdMob publisher ID"
  ads:adSize="BANNER"/> 

I then add the following to my java code for this UI

AdView adview = (AdView)findViewById(R.id.adView);  
AdRequest re = new AdRequest();  
re.setTesting(true);  
adview.loadAd(re); 

The problem I have is that I have no xml called "adView". I’ve tried a few different versions of the Java code (each tutorial is a bit different) but all result in a similar java error. What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:46:57+00:00Added an answer on June 17, 2026 at 12:46 am

    You haven’t got any R.id.adView (at least in the code you paste), you have to use R.id.adMob, because this is the view’s ID.
    You have to add this to your Layout file:

    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am beginning in iPhone development and have followed a few tutorials, but please
I don't have experience in php. I've followed a few tutorials to modify my
Followed a few tutorials and I'm having no luck, I'm trying to add a
I have followed a few tutorials on creating a custom property editor dialog, but
I have followed a few online tutorials and managed to install custom item templates
I have followed the following documentation and I am having problems. I access the
Hi have followed this tutorial using Core plot framework http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application My project compiles, but
I have followed his popular tutorial to connect Android to MySQL: http://www.helloandroid.com/tutorials/connecting-mysql-database It is
I followed a few sites and have come to this: <?php $imagesDir = base_url()
I am trying to configure authentication using a few tutorials I have found on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.