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

  • Home
  • SEARCH
  • 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 8623399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:16:15+00:00 2026-06-12T07:16:15+00:00

I am currently able to get the admob ads on ui view (in separate

  • 0

I am currently able to get the admob ads on ui view (in separate test project ), but i want to display this ad in GLSurfaceView .
I tried to load the ad in onCreate( ) method of activity and in present method of my screen (where all rendering is done) i called

MyGameActivity.mAdView.bringToFront(); //thought it will bring the ad in front of all the game objects.

now on running the project i can see the message in logcat window Recieved ad url "big url"
but i cant see the ad on screen. In my game there is only one activity and many game screens. please help me figure out how to display ads on my game screen.

  • 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-12T07:16:17+00:00Added an answer on June 12, 2026 at 7:16 am

    You should modify your layout to be something like this:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layoutMain"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >       
        <RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/layout1"
            android:tag="trueLayout"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            >       
        </RelativeLayout>
    </LinearLayout>
    

    This is my code, which is self explanatory.:

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        
    
        setContentView(R.layout.main);
    
        LinearLayout layoutMain = (LinearLayout) findViewById(R.id.layoutMain);
    
        // Create the adView
        // Please replace MY_BANNER_UNIT_ID with your AdMob Publisher ID
        adView = new AdView(this, AdSize.BANNER, "YourPersonalID#"); 
    
        layoutMain.addView(adView);
    
        // Initiate a generic request to load it with an ad
        AdRequest request = new AdRequest();
        request.setTesting(true);
    
        adView.loadAd(request);     
    
        RelativeLayout layout1 = (RelativeLayout) findViewById(R.id.layout1);
        layout1.setOnTouchListener(this);
    
        mTestHarness = new GLSurfaceView(this);
        mTestHarness.setEGLConfigChooser(false);
        mTestHarness.setRenderer(this);
            mTestHarness.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);    
    
        layout1.addView(mTestHarness);
    }
    

    After you get this right you will get the equivalent to the BannerEssentials tutorial app from the google play tutorials, but using GLSurfaceView instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently able to get this to do most of what I want to.
i want to get the count of photos in photoLibrary. Currently, i'am able to
I want to be able to get the SessionID of the currently authenticated session
I'm currently working on a web-project where we need to be able to get
In my plugin i want to be able to get a field value, but
I currently have a form with inputs and name attributes. I'm able to get
I am able to get the current date, but I don't know how to
I want to be able to get the current bound object in the ItemTemplate
I am currently able to get the location when I set the Criteria accuracy
I am currently able to successfully access and get data from the peoplePickerNavigationController ,

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.