title: Integrating admob into Android app
body: <p>Been having some trouble trying to integrate the admob sdk into my application to display ads. Im using the AdmobSDK version 4.1.0. I've read loads of posts and there seems to be lacking some decent documentation and many discussions on the topic including <a href="http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/3b885d3fe5bb21a5?pli=1" rel="nofollow">http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/3b885d3fe5bb21a5?pli=1</a> So far my layout is..</p>
  
  <pre><code>&lt;ScrollView 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
  android:id="@+id/scroll" 
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"&gt;
  
  &lt;LinearLayout
      android:id="@+id/linear" 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      android:focusable="true"
      android:focusableInTouchMode="true"&gt;
  
      &lt;com.google.ads.AdView 
          android:id="@+id/ad" 
          android:layout_width="fill_parent" 
          android:layout_height="wrap_content" 
          ads:adUnitId="MY_PUB_CODE" 
          ads:adSize="BANNER"/&gt;       
  
  &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>my androidmanifest.xml contains...</p>
  
  <pre><code>&lt;activity android:name="com.google.ads.AdActivity"
  android:configChanges="keyboard|keyboardHidden|orientation"&gt;&lt;/activity&gt;
  
  &lt;meta-data android:value="MY_PUBLISHER_ID" android:name="ADMOB_PUBLISHER_ID"&gt;&lt;/meta-data&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"&gt;&lt;/uses-permission&gt;
  </code></pre>
  
  <p>EDIT, UPDATE:</p>
  
  <p>Ok i seem to have gotten admob working on my HTC by adding,</p>
  
  <pre><code>AdView ad = (AdView) findViewById(R.id.ad);
  AdRequest r = new AdRequest()
  r.addTestDevice("X3XFX518X7DE1FD879XA5XXAX1AX8BXX");
  ad.loadAd(r);
  </code></pre>
  
  <p>however i only recieve a test banner, stating im ready to explore the google app galaxy. When i remove the "addTestDevice" method, the banner/ad does not show up atal and in the log i recieve, "ad not recieved due to lack of inventory" .. Anyone sheed some light on this?</p>
  
  <p>thanks for the help so far!</p>