Stanislav
Stanislav

Reputation: 425

AdView shows only test banner on emulator

I've just created an account on AdMobs, created banner for test.

The code is from BannerExample, without addTestDevice(...)

public class MyActivity extends ActionBarActivity {

private AdView mAdView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my);

    // Gets the ad view defined in layout/ad_fragment.xml with ad unit ID set in
    // values/strings.xml.
    mAdView = (AdView) findViewById(R.id.ad_view);

    // Create an ad request. Check logcat output for the hashed device ID to
    // get test ads on a physical device. e.g.
    // "Use AdRequest.Builder.addTestDevice("ABCDEF012345") to get test ads on this device."
    AdRequest adRequest = new AdRequest.Builder()
            .build();

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

activity_my.xml

    <com.google.android.gms.ads.AdView
    android:id="@+id/ad_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ca-app-pub-6784520601040456/7994286128" />

But I see only Test banner, when I launch the application.

Should I specify something else, to see the real banner?

Upvotes: 0

Views: 642

Answers (1)

Vaizadoo
Vaizadoo

Reputation: 330

Try to check it out in real device. Add usually doesnt show in emulator.

Upvotes: 2

Related Questions