August 27th, 2010, 03:05 AM
|
#2 (permalink)
|
|
New Member
Join Date: Aug 2010
Location: Sweden
Posts: 13
Device(s): Motorola Milestone
Carrier: Not Provided
Thanks: 0
Thanked 1 Time in 1 Post
|
Android - Admob For Developers has quite straightforward instructions. It's missing one step that the LunarLander has. Not sure if it's needed, but it might aid debugging at least. The LunarLander example set an AdListener, which logs when ads are fetched, or when they failed to be fetch.
It's also straightforward to do. Just make user Activity class implement com.admob.android.ads.AdListener, and then implement the following methods in your Activity class:
Code:
public void onFailedToReceiveAd(AdView adView)
{
Log.d("AdListener", "onFailedToReceiveAd");
}
public void onFailedToReceiveRefreshedAd(AdView adView)
{
Log.d("AdListener", "onFailedToReceiveRefreshedAd");
}
public void onReceiveAd(AdView adView)
{
Log.d("AdListener", "onReceiveAd");
}
public void onReceiveRefreshedAd(AdView adView)
{
Log.d("AdListener", "onReceiveRefreshedAd");
}
You also need to set the listener in your Activity's onCreate:
Code:
AdView ad = (AdView) findViewById(R.id.ad);
ad.setAdListener(this);
If you still can't get it to work, please post logcat output, which should include the traceback. It would also be very helpful to see your code, at least the parts that deals with AdMob.
|
|
|