Good evening.
I am currently developing an application and decided to try Admob ads. Unfortunately after following Admob's guide (pretty simple one, good job on that) I get no ad, whether I run it on the emulator or on my phone (HTC Desire). The weird part is that the ad has shown a couple of times (i really mean just a couple of times), in hundreds of tries. And checking my account on Admob I see that there are 6000 requests from this app. I started a new applcation, from blank, with no changes.
Any clues?
This is what I have done so far:
Added Adbmo's library jar.
Added these in my manifest (with a proper ID):
meta-data android:value="axxxxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" /
uses-permission android:name="android.permission.INTERNET" /
Created a attrs.xml file in res/values with this content:
?xml version="1.0" encoding="utf-8"?>
resources>
declare-styleable name="com.admob.android.ads.AdView">
attr name="backgroundColor" format="color" />
attr name="primaryTextColor" format="color" />
attr name="secondaryTextColor" format="color" />
attr name="keywords" format="string" />
attr name="refreshInterval" format="integer" />
/declare-styleable>
/resources>
Added the following to my layoyt (RelativeLayout):
below RelativeLayout line, with the correct application name instead of xxxx: xmlns:app="http://schemas.android.com/apk/res/com.me.xxxx"
and:
com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:backgroundColor="#000000"
app:primaryTextColor="#FFFFFF"
app:secondaryTextColor="#CCCCCC"
/>
As the above did not work I tried the following, but also without success:
AdView example_adview = (AdView) findViewById(R.id.ad); example_adview.setVisibility(AdView.VISIBLE); example_adview.requestFreshAd();
I would appreciate if someone could help me.
An off-topic question, when running my application (only this one) in ecplise (Windows), I always the device chooser, even though only my phone is connected and the emulator is not running. It's nothing that disturbs my development, but it's a bit annoying having to choose every time I run the application.
Thank you very much,
Kryex