I am using the AdMob view in an Android application, but I canโt get any ad in the application.
For reference, I added a view to the ListView, as Dan Dyer explained here
EDIT: I am using GoogleAdMobAdsSdk-4.1.1. The release notes for the Google AdMob SDK for version 4.1.0 say:
"... - Added support for AdRequest.addTestDevice () and AdRequest.setTestDevices (). Note that AdRequest.setTesting () is now deprecated. ..."
Since the ad has been added to my ListView:
public View getView(int position, View convertView, ViewGroup parent) { // Some other code // Reusing convertView etc. AdView adView = new AdView((Activity) getContext(), AdSize.BANNER, "/xxxxxx/ca-pub-xxxxxxx/my_ad_unit"); for (int i = 0; i < adView.getChildCount(); i++) { adView.getChildAt(i).setFocusable(false); } adView.setFocusable(false); float density = getContext().getResources().getDisplayMetrics().density; int height = Math.round(50 * density); AbsListView.LayoutParams params = new AbsListView.LayoutParams( AbsListView.LayoutParams.FILL_PARENT, height); adView.setLayoutParams(params); AdRequest request = new AdRequest(); request.addTestDevice("xxxxxxxxxxxxxxxxx"); adView.loadAd(request); // other stuff // returning convertView }
I also added an AdListener to adview, and the onFailedToReceiveAd callback method is called on each loadAd:
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) { Log.d(TAG, "AdMob in list failed to receive ad: " + arg1.name()); }
In logcat, I get this message:
08-17 15:22:18.065: AdMob in list failed to receive ad: NO_FILL
Can someone tell me what this error code means?
source share