First of all, I know that there are many questions on this topic. I searched all over the Internet, but most tutorials are about older versions of AdMob. In addition, everyone has some other solution to the problem. All of them do not work for me. I am very close to adding these test add-ons to my application. They just don't appear. I get the following errors:
02-21 21: 05: 46.457: W / webcore (14924): it is impossible to get the width view after the first layout
02-21 21: 05: 46.586: W / Ads (14924): Invalid request error: Unable to determine the type of request. Is the ad unit ID set correctly?
02-21 21: 05: 46.586: D / webviewglue (14924): nativeDestroy view: 0x685300
02-21 21: 05: 46.586: I / Ads (14924): onFailedToReceiveAd (invalid Google Ad. Request)
I donβt have an AdMob publisher ID yet, as this will be my first APP for the market (and I must first have APP in the market before I get the ID for APP). Which identifier should I use? Currently I have (testing on an Android phone):
AdRequest adRequest = new AdRequest(); adRequest.addTestDevice("9B08CXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); //adRequest.addTestDevice("037c7xxxxxxxxxxx"); (Not right, is from console) AdView adView = (AdView) this.findViewById(R.id.adView); adView.loadAd(adRequest);
In my XML I have (because it also warns about viewWidth?). It is packaged in a larger LinearLayout file:
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="50dip"> <com.google.ads.AdView android:id="@+id/adView" android:layout_width="fill_parent" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="@string/admob_pub_id"/> </LinearLayout>
I hope this question is small enough, but it still contains enough information.
Thanks in advance! Best wishes, Jos.
EDIT: I have a manifest file changed (add permissions, activity android: name = ..., android: configChanges = ...). I added the jar to the lib folder and added it to the libraries.