As we know, google requires us to use test device and test ad unit id, when we develop the app. However, I want to know that if there exists anyway that I can see the real ad, b
You can use AdListener and monitor why it is not showing ads . Remember if you have created fresh ad units then it will take some time or few hours to arrange live ads for it . If test ads are showing and you have valid ad unit id and also your app has not violated any policy then you are good to go (You will be emailed if your app have a policy issue) . Ads will be shown when availabe.
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest1 = new AdRequest.Builder().build();
adView.loadAd(adRequest1);
adView.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
// Code to be executed when an ad finishes loading.
Log.i("Ads", "onAdLoaded");
}
@Override
public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
switch (errorCode){
case AdRequest.ERROR_CODE_INTERNAL_ERROR:
Toast.makeText(PlayListsActivity.this,"onAdFailedToLoad banner ERROR_CODE_INTERNAL_ERROR",Toast.LENGTH_SHORT).show();
break;
case AdRequest.ERROR_CODE_INVALID_REQUEST:
Toast.makeText(PlayListsActivity.this,"onAdFailedToLoad banner ERROR_CODE_INVALID_REQUEST",Toast.LENGTH_SHORT).show();
break;
case AdRequest.ERROR_CODE_NETWORK_ERROR:
Toast.makeText(PlayListsActivity.this,"onAdFailedToLoad banner ERROR_CODE_NETWORK_ERROR",Toast.LENGTH_SHORT).show();
break;
case AdRequest.ERROR_CODE_NO_FILL:
Toast.makeText(PlayListsActivity.this,"onAdFailedToLoad banner ERROR_CODE_NO_FILL",Toast.LENGTH_SHORT).show();
break;
}
Log.i("Ads", "onAdFailedToLoad");
}
@Override
public void onAdOpened() {
// Code to be executed when an ad opens an overlay that
// covers the screen.
Log.i("Ads", "onAdOpened");
}
@Override
public void onAdLeftApplication() {
// Code to be executed when the user has left the app.
Log.i("Ads", "onAdLeftApplication");
}
@Override
public void onAdClosed() {
// Code to be executed when when the user is about to return
// to the app after tapping on an ad.
Log.i("Ads", "onAdClosed");
}
});