title: adding google ads to android app
body: <p>i am tying to add google ads to my app(this is my 1st time). i have added the jar file also.</p>
  
  <p>Here is the xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:background="@color/headerbgcolor"
          android:weightSum="1" &gt;
  
          &lt;Button
              android:id="@+id/back"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="0.2"
              android:text="@string/back" 
              android:onClick="finishActivity"/&gt;
  
          &lt;TextView
              android:id="@+id/headertitle"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:layout_weight="0.6"
              android:gravity="center"
              android:text="@string/header_title" /&gt;
  
          &lt;Button
              android:id="@+id/home"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="0.2"
              android:text="@string/home" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="wrap_content"
          android:layout_height="320dp"
          android:scrollbarAlwaysDrawVerticalTrack="true" &gt;
      &lt;/ListView&gt;
  
      &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" &gt;
  
  
          &lt;com.google.ads.AdView
          android:id="@+id/adView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          ads:adSize="BANNER"
          ads:adUnitId="a14f26e5d930307"
          ads:loadAdOnCreate="true"
          ads:testDevices="AVD_for_4in_WVGA_Nexus_S,5554" /&gt;
  
  
  
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>but i am not able to define adview in my class, when i am trying to define it in the class.</p>
  
  <p>here is my class where i am tryin to define.</p>
  
  <pre><code>public class Cities extends Activity {
  
      Button btnback = null;
      Button btnhome = null;
      TextView headertitle = null;
      ListView lstcities;
      ImageView imgfooter;
      AdView adView; 
      public String BtnSelected; 
  </code></pre>
  
  <p>i am getting error Adview cannot be resolved to type, when i'm trying to define </p>
  
  <pre><code>AdView adview;
  </code></pre>
  
  <p>what is the poblem?</p>