title: XML or Java Keywords in Android for Admob
body: <p>I can't seem to find any rock solid documentation on setting keywords for adMob ads via XML or Java. I've tried the methods seen in <a href="https://stackoverflow.com/questions/5066129/android-admob-api-and-keywords">this</a> thread, but have failed in both respects. My failures for each case are below.</p>
  
  <p>When trying to use methods setKeywords(), setSearchQuery(), or requestFreshAd() from the AdView class, it's like Eclipse doesn't recognize that those methods are part of the AdView class. Could I be instantiating this class improperly? My java code is below:</p>
  
  <pre><code>import com.google.ads.AdRequest;
  import com.google.ads.AdView;
  
  AdView adView = (AdView)this.findViewById(R.id.adView);
      adView.loadAd(new AdRequest());
  </code></pre>
  
  <p>If I try to call the aforementioned methods, (eg.  adView.setKeywords() ), Eclipse doesn't recognize the methods.  What am I doing wrong?</p>
  
  <p>When I attempt to set the keywords via XML, the code seems to run ok, but I don't get any valid requests for an add.  The log returns with a "No ad to display" message.  In this case, I don't know if I'm just not getting a result from my keywords or if I'm not settings the keyword string correctly.</p>
  
  <p>The following depicts how I'm setting the keywords via XML:</p>
  
  <p>...in attrs.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;resources&gt;
    &lt;declare-styleable name="com.google.ads.AdView"&gt;
     &lt;attr name="adSize"&gt;
        &lt;enum name="BANNER" value="1"/&gt;
        &lt;enum name="IAB_MRECT" value="2"/&gt;
        &lt;enum name="IAB_BANNER" value="3"/&gt;
        &lt;enum name="IAB_LEADERBOARD" value="4"/&gt;
     &lt;/attr&gt;
     &lt;attr name="adUnitId" format="string"/&gt;
     &lt;attr name="test" format="boolean"/&gt;
     &lt;attr name="keywords" format="string"/&gt;
    &lt;/declare-styleable&gt;
   &lt;/resources&gt;
  </code></pre>
  
  <p>in layout.xml....</p>
  
  <pre><code>    &lt;com.google.ads.AdView android:id="@+id/adView"
          android:layout_width="fill_parent"
          android:layout_gravity="bottom"
          android:layout_height="wrap_content"
          ads:adUnitId="blahblahblhal"
          ads:adSize="BANNER"
          ads:test="true"
          ads:keywords="farts cheese stink pooper"/&gt;
  </code></pre>
  
  <p>Obviously, these are not the keywords I'm using, but the syntax by which I set the keywords is the same as I've been using.</p>
  
  <p>If there is no ad to display is it because I'm using too many keywords, improper syntax, and what if I want to use a phrase instead of a keyword?  How would I go about doing that?</p>
  
  <p>If there is documentation on the AdMob site pertaining to this I apologize.  But if so, they made it pretty damn hard to find.</p>
  
  <p>Thanks</p>