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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:08:25+00:00 2026-06-10T22:08:25+00:00

I try to make android app with AdMob. I create the admob adView as

  • 0

I try to make android app with AdMob.

I create the admob adView as described in documentation:

FrameLayout layout = (FrameLayout) findViewById(R.id.frame_layout);
adView = new AdView(this, AdSize.SMART_BANNER, myAdMobId );

Then, if I run my app on a device 320×480 (phone), the advert banner appears on the top, but if I run my app on a android tablet 1280×800, the advert banner appears centered horizontally and vertically – at the center of screen.

Also, I tried AdSize.BANNER, AdSize.IAB_BANNER, AdSize.IAB_LEADERBOARD – result is the same.

What I am doing wrong?

UPD1. res/layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/frame_layout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
<com.mysite.myapp.GameView
      android:id="@+id/game"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/>    
</FrameLayout>
  • 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-10T22:08:27+00:00Added an answer on June 10, 2026 at 10:08 pm

    This should do the trick.

         FrameLayout.LayoutParams adsParams =new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT, 
                FrameLayout.LayoutParams.WRAP_CONTENT, android.view.Gravity.TOP|android.view.Gravity.CENTER_HORIZONTAL); 
    
        layout.addView(adView, adsParams);
    

    in what you did in the xml, you didn’t specify any gravity.

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

Sidebar

Related Questions

Hello I am new to android dev and admob. I am trying to make
When I try to make a make an Android app with GreenDroid, so I
I try to make an Android App with Scala, SBT and Google Maps. plugins.scala:
I'm new to android development and I'm trying to make an android app that
I am kind of new to php. I try to make an app in
I try to make an Android application which communicates with a non-standard ISO15693 (NFC-V)
i want to make empty textbox checking for android. i tried try catch but
I need to make an android App that when the user navigates to my
I want to make an App Engine connected Android app, and I'm beginning with
I'm making Android app that has this database in it: public void onCreate(SQLiteDatabase db)

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.