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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:44:53+00:00 2026-06-14T12:44:53+00:00

I am having a hard time integrating an Admob banner into my game. I

  • 0

I am having a hard time integrating an Admob banner into my game. I have used simple-xml-2.6.2.jar library because I considered it to be simple to implement into my game. Now I have a single layout file, with the correct code for publisher ID and test device:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     ads:adUnitId="xxxxxxxxxxx"
                     ads:adSize="BANNER"
                     ads:testDevices="TEST_EMULATOR, zzzzzzzzzzzz"
                     ads:loadAdOnCreate="true"/>
</LinearLayout>

The game runs in landscape mode, and I would like tu get the ads to show as a banner at the top or bottom, but there aren’t any test ads being shown, and I haven’t got any ideas as to why is that.
Any help is apreciated!

  • 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-14T12:44:55+00:00Added an answer on June 14, 2026 at 12:44 pm

    Use below code in xml say xml name is adview.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/adView"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="50dip"/>
    

    Now in your Activity load the ad.

     AdView adView = new AdView(this,AdSize.BANNER,"yourid");
     LinearLayout ll= (LinearLayout) findViewById(R.id.adView);
     ll.addView(adView);
     AdRequest ar = new AdRequest();
     ar.setGender(AdRequest.FEMALE);
     adView.loadAd(ar);
    

    You can include this view(xml) in any of your activity from xml like this..

     <include layout="@layout/adview" />  // your xml
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having hard time with this simple ajax call function sendreq() { $.ajax({ dataType:
I'm having hard time to find out how to read and write from /into
I'm willing to make a isometric game but I'm having hard time with the
I having hard time understanding importance and benefits of Annotations and so have two
i am having hard time to fix my problem on VirtualStringTree. I have NodeData
I'm having hard time wrapping my head around this. I have an array called
I'm having hard time learning collision detection by experience. I'm making a box game,
I have been having hard time with Primefaces and SO is my ultimate place
i'm having hard time for a pretty silly simple task i need to add
I'm having a hard time getting XML values from an XML file using XPath.

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.