I followed instructions on https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start
I changed the test code in strings.xml to real code. But the app is still showing test ads.(I have not posted the app on play store)
It appears in emulator like this https://drive.google.com/file/d/0B6InEecSXedCNmM4eUVrTzVGaFU/view?usp=sharing Here is activity_main.xml code
android:layout_alignRight="@+id/adView"
android:layout_alignEnd="@+id/adView" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
</com.google.android.gms.ads.AdView>
and here is a part of java code
Button = (ImageButton) findViewById(R.id.button);
Button.setOnClickListener(new MyOnClickListener());
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}
The Google Mobile Ads SDK will only display test ads on the emulator. If you switch to debugging on a real device, you will see live, production ads unless you register the device with the addTestDevice call.
As Abishek points out, it is a violation of AdMob policy to request real ads when you're testing and debugging, and this can result in the suspension of your account. The SDK automatically requests test ads to prevent this from happening.