title: Android + Phonegap + Admob
body: <p>As the title suggests I am trying to create an Android app using Phonegap and then trying to insert Admob into it.</p>
  
  <p>I am using <a href="http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html" rel="nofollow">this tutorial</a> provided by Adobe and it is working fine. After this when I use <a href="https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals" rel="nofollow">this tutorial</a> provided by Google I run into problems. 
  According to the Google tutorial, I have to change the activity class, below is the original and the second block of code is the altered code. There doesn't seem to be any errors preventing it from compiling. It's just when I try and run it using the Android emulator I get an error stating "Unfortunately MyFirstPhonegapPlugin has stopped"  </p>
  
  <p>Note, using the Google tutorial, there are two ways of implementing the code, using just the class below and using a mixture of XML and the class below. I tried the other way and due to getting errors which doesn't let me compile, I've gone for this way.</p>
  
  <pre><code>package com.tricedesigns;
  import org.apache.cordova.DroidGap;
  import android.os.Bundle;
  
  public class MyFirstPhoneGapPluginActivity extends DroidGap {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          super.loadUrl("file:///android_asset/www/index.html");
      }
  }
  </code></pre>
  
  <p>Adjusted code:</p>
  
  <pre><code> package com.tricedesigns;
  
      import org.apache.cordova.DroidGap;
      import android.os.Bundle; 
      import com.google.ads.*;
  
  
      public class MyFirstPhoneGapPluginActivity extends DroidGap {
          /** Called when the activity is first created. */
          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              super.loadUrl("file:///android_asset/www/index.html");
              // Look up the AdView as a resource and load a request.
              AdView adView = (AdView)this.findViewById(R.id.adView);
              adView.loadAd(new AdRequest());
            }
          }
  </code></pre>
  
  <p>I am using Phonegap 1.6.1 and the most up to date SDK for Android and Admob </p>