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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:05:31+00:00 2026-06-11T15:05:31+00:00

i am very new to the android app development, and i have just almost

  • 0

i am very new to the android app development, and i have just almost completed one app finally, and now i am trying to add admob to the app in order to show the ad undernearth.

i have installed that GoogleAdMobAdsSdkAndroid.zip version 6.1.0 and also downloaded the example from google at https://developers.google.com/mobile-ads-sdk/docs/android/fundamentals?hl=zh-CN and there is one line

adView = new AdView(this, AdSize.BANNER, AD_UNIT_ID_GOES_HERE);

that has bug AD_UNIT_ID_GOES_HERE highlighted.

  1. is that i must replace the above AD_UNIT_ID_GOES_HERE by registering and getting an admob account? I have not registered any admob account yet.
  2. Is that then i cannot test and preview about the ad if i have no true admob account? are there any ID available solely for testing purposes before i really register for a real one?

The java code is solely copied from the above google website and pasted as follows. android manifest and xml are also same as those in the google example.

package com.google.example.ads.fundamentals;

import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;

/**
 * A simple {@link Activity} that embeds an AdView.
 */
public class BannerSample extends Activity {
/** The view to show the ad. */
  private AdView adView;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Create an ad.
    adView = new AdView(this, AdSize.BANNER, AD_UNIT_ID_GOES_HERE);

    // Add the AdView to the view hierarchy. The view will have no size
    // until the ad is loaded.
    LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout);
    layout.addView(adView);

    // Create an ad request. Check logcat output for the hashed device ID to
    // get test ads on a physical device.
    AdRequest adRequest = new AdRequest();
    adRequest.addTestDevice(AdRequest.TEST_EMULATOR);

    // Start loading the ad in the background.
    adView.loadAd(adRequest);
  }

  /** Called before the activity is destroyed. */
  @Override
  public void onDestroy() {
    // Destroy the AdView.
    if (adView != null) {
      adView.destroy();
    }

    super.onDestroy();
  }
}
  • 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-11T15:05:32+00:00Added an answer on June 11, 2026 at 3:05 pm

    Just make yourself an account. It’s free!

    You can’t show ads without an publisher id.

    enter image description here

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

Sidebar

Related Questions

I'm very new to Android development and just started to study. What I'm trying
I am very new to android development.... i have created an app and want
I am very new with android development. My app has a lot of views/Activity
I am very new to Android development and Java. Have read around but I'm
I have been slowing learning and building my first android app. I'm VERY new
I am very new to Android development. I am converting my iPhone app to
Im very new to this android development.I just started to create a hello world
I'm very new to android development. I would like to make a android app
I am very new to Android development. I have this code: Button btnLaunch; btnLaunch=(Button)findViewById(R.id.btnLaunch);
I am very new to java and trying to develop an Android app called

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.