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 6017085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:04:42+00:00 2026-05-23T03:04:42+00:00

Been having some trouble trying to integrate the admob sdk into my application to

  • 0

Been having some trouble trying to integrate the admob sdk into my application to display ads. Im using the AdmobSDK version 4.1.0. I’ve read loads of posts and there seems to be lacking some decent documentation and many discussions on the topic including http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/3b885d3fe5bb21a5?pli=1 So far my layout is..

<ScrollView 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/scroll" 
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<LinearLayout
    android:id="@+id/linear" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:focusable="true"
    android:focusableInTouchMode="true">

    <com.google.ads.AdView 
        android:id="@+id/ad" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        ads:adUnitId="MY_PUB_CODE" 
        ads:adSize="BANNER"/>       

</LinearLayout>
</ScrollView>

my androidmanifest.xml contains…

<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"></activity>

<meta-data android:value="MY_PUBLISHER_ID" android:name="ADMOB_PUBLISHER_ID"></meta-data>

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>

EDIT, UPDATE:

Ok i seem to have gotten admob working on my HTC by adding,

AdView ad = (AdView) findViewById(R.id.ad);
AdRequest r = new AdRequest()
r.addTestDevice("X3XFX518X7DE1FD879XA5XXAX1AX8BXX");
ad.loadAd(r);

however i only recieve a test banner, stating im ready to explore the google app galaxy. When i remove the “addTestDevice” method, the banner/ad does not show up atal and in the log i recieve, “ad not recieved due to lack of inventory” .. Anyone sheed some light on this?

thanks for the help so far!

  • 1 1 Answer
  • 1 View
  • 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-05-23T03:04:43+00:00Added an answer on May 23, 2026 at 3:04 am

    To your comment, I use this and it works quite well for me. The size is the second param of the AdView constructor.

    ad = new AdView(this, AdSize.BANNER, "<ID>");
    LinearLayout layout = (LinearLayout) findViewById(R.id.main_admob_layout);
    // Add the adView to it
    layout.addView(ad);
    AdRequest request = new AdRequest();
    request.setTesting(TESTING_MODE);
    ad.loadAd(request);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I've been having a bit of trouble trying to attach files using a
Hi I've been having some trouble trying to get a list view I created
I've been having some trouble lately while trying to learn how to do an
I'm trying to implement ActionBarSherlock in my existing application, but I've been having some
Ive been having some trouble using Plot to graph a complicated composite function. I
Been having some trouble implementing a single-column index in LaTeX. I've been employing the
I've been having some trouble with my .htaccess file lately (my entire site goes
I've been having some trouble with vs2008 SP1 running in debug mode when I
I've been reading through Programming Clojure, and I've been having some trouble understanding Stuarts
I have been having some real trouble with this for a while. I am

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.