title: Admob - Not able to show banner in android app
body: <p>I am trying to check how admob works. </p>
  
  <p>Till time I am done with including admob like this</p>
  
  <p><strong>Manifest File</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.androidbannertutorial"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="9"
          android:targetSdkVersion="21" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
           &lt;meta-data android:name="com.google.android.gms.version"
                 android:value="@integer/google_play_services_version"/&gt;
  
  
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
  
           &lt;activity android:name="com.google.android.gms.ads.AdActivity"
               android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>My XML File</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:ads="http://schemas.android.com/apk/res-auto"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                &gt;
  
     &lt;!-- &lt;com.google.android.gms.ads.AdView 
          android:id="@+id/adView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adUnitId="ca-app-pub-4493208dfbf2258768/7749751738 "
    ads:adSize="BANNER"
     ads:loadAdOnCreate="true"/&gt; --&gt;
  
  
       &lt;LinearLayout 
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:id="@+id/ll"
          android:layout_alignParentBottom="true"
          /&gt;
  
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>My main activity class</strong></p>
  
  <pre><code>package com.example.androidbannertutorial;
  
  import com.google.android.gms.ads.AdRequest;
  import com.google.android.gms.ads.AdSize;
  import com.google.android.gms.ads.AdView;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.widget.LinearLayout;
  
  /**
   * A simple {@link Activity} that embeds an AdView.
   */
  public class MainActivity extends Activity {
    /** The view to show the ad. */
    private AdView adView;
  
    /* Your ad unit id. Replace with your actual ad unit id. */
    private static final String AD_UNIT_ID = "ca-app-pub-4493sdf352258768/7749751738";
  
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // Create an ad.
      adView = new AdView(this);
      adView.setAdSize(AdSize.BANNER);
      adView.setAdUnitId(AD_UNIT_ID);
  
      // Add the AdView to the view hierarchy. The view will have no size until the ad is loaded.
      LinearLayout layout = (LinearLayout) findViewById(R.id.ll);
      layout.addView(adView);
  
      // Create an ad request. Check logcat output for the hashed device ID to get test ads on a physical device.
      AdRequest adRequest = new AdRequest.Builder()
          /*.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
          .addTestDevice("INSERT_YOUR_HASHED_DEVICE_ID_HERE")*/
          .build();
  
      // Start loading the ad in the background.
      adView.loadAd(adRequest);
    }
  
    @Override
    public void onResume() {
      super.onResume();
      if (adView != null) {
        adView.resume();
      }
    }
  
    @Override
    public void onPause() {
      if (adView != null) {
        adView.pause();
      }
      super.onPause();
    }
  
    @Override
    public void onDestroy() {
      // Destroy the AdView.
      if (adView != null) {
        adView.destroy();
      }
      super.onDestroy();
    }
  }
  </code></pre>
  
  <p><strong>Ques: Why we use this .. ???????</strong></p>
  
  <pre><code>.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
              .addTestDevice("INSERT_YOUR_HASHED_DEVICE_ID_HERE")
  </code></pre>
  
  <p>I have included <strong>google_play_lib</strong> into my app.</p>
  
  <p>I have my addUnitId : <strong>ca-app-pub-4493438885ds9958768/7749751738</strong></p>
  
  <p><strong>Here my banner is not shown up within app.</strong></p>
  
  <p>Only error I am recieving is : <strong>The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.</strong></p>
  
  <p>Even though I have configured with in app.</p>
  
  <p>Can some one help me out what's I extra need to do ?</p>
  
  <p>Thanks.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I am receiving ads after time lapse of 3-4 hours. Can't understand why this behavior occurs ??</p>