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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:36:20+00:00 2026-06-05T10:36:20+00:00

How to integrate admob into my Android app? I have use this link: google

  • 0

How to integrate admob into my Android app?

I have use this link: google code
but I think there are not all the information needed.

  • 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-05T10:36:21+00:00Added an answer on June 5, 2026 at 10:36 am

    I’m not too certain about the tutorial, as I just worked through the API to get it to work. Here’s my code:

    AdView adView = new AdView(OOKL.this, AdSize.BANNER, MY_AD_UNIT_ID);
    LinearLayout al = (LinearLayout) findViewById(R.id.AdLayout);
    al.addView(adView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    
    adReq = new AdRequest();
    adReq.setTesting(IS_DEBUG);
    adView.loadAd(adReq);
    adView.setAdListener(new AdListener() {
        public void onReceiveAd(Ad ad) {
            setAdVisible(true);
        }
    
        public void onFailedToReceiveAd(Ad ad, AdRequest.ErrorCode error) {
            setAdVisible(false);
        }
    
        public void onPresentScreen(Ad ad) {
        }
    
        public void onDismissScreen(Ad ad) {
        }
    
        public void onLeaveApplication(Ad ad) {
        }
    });
    
    private void setAdVisible(boolean show) {
        View v = this.findViewById(R.id.AdLayout);
        v.setVisibility(show ? View.VISIBLE : View.GONE);
    }
    

    This is pretty much all you need. Here IS_DEBUG is my private variable controlling whether I’m running in test mode or live production. MY_AD_UNIT_ID is the ad unit ID you get when you register the app with AdMob. AdLayout is a LinearLayout that would contain the AdView – it’s the first child in a vertical LinearLayout.

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

Sidebar

Related Questions

I'm trying to integrate ads (admob) into my Android app. It's mostly working, except
I'm trying to integrate an admob banner into my Android game. I have a
I am trying to integrate OpenFeint 2.12.5 into my app. I already read this
I am trying to integrate kiip in my android app . I have downloaded
I have successfully integrate AdWhirl (v3.0) with AdMob in InMobi. Now when my app
I am trying to integrate AdMob into my Android Application, and can get it
Is it possible to integrate Qype into my android application? Also, are there any
integrate twitter with my android app i successfully get the token and tokeSecreat but
Is there a way to integrate iAd and AdMob in one project so that
I need to integrate some legacy 32-bit code - for which I don't have

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.