I have been looking for an answer for a while, but I cannot find the same set of circumstances, so I am turning to you for help ...
I am trying to use the Google SDK (not admob sdk) to advertise on my Android app. When I run the application in the emulator, the log messages that I see are as follows:
03-25 22:35:17.457: INFO/Ads(853): adRequestUrlHtml: [ contains two <script> tags ] 03-25 22:35:21.028: INFO/Ads(853): Received ad url: [ big long url ]
Sometimes I get:
03-25 22:35:21.828: INFO/Ads(853): onFailedToReceiveAd(No ad to show.)
which maybe I can understand, but I also get:
03-25 22:50:56.817: INFO/Ads(1084): onFailedToReceiveAd(A network error occurred.)
If I find the “big long url” above in my desktop browser, I get a 1/2 time announcement and another 1/2 space. (Hello, Dish Network) I never get an error.
I can browse the web using the emulator browser, so the network component works.
The application has Internet privileges.
I am upset by the lack of usability code - I see a lot of people using the old admob SDK and a few code snippets for people using the Google SDK, but not an example / walnut soup example.
I commented on the rest of my code, but to no avail. Here is the main code snippet:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); AdView adView = new AdView(this, AdSize.BANNER, ADMOB_PUBLISHER_ID); LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout); layout.addView(adView); AdRequest req = new AdRequest();
My manifest includes the following:
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/>
and
<uses-permission android:name="android.permission.INTERNET" />
My main.xml contains this page layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/yellow" android:id="@+id/mainLayout" >
Admob support did not respond.
Can someone help me or at least direct me to the perfect google sdk guide for admob noobs?
Thanks!