question

Draw2GO avatar image
Draw2GO asked

Amazon Ads Issues

Hello - I am using PhoneGap, and I'm pretty sure that I'm VERY close to getting the ads to work. However, with this code... /**** CODE STARTS HERE ****/ package com.quantumrand.amazonAdsPlugin; import org.apache.cordova.*; import android.os.Bundle; import android.util.Log; import android.view.Gravity; import android.view.ViewGroup; import android.widget.LinearLayout; import android.os.Handler; import com.amazon.device.ads.*; import com.amazon.device.ads.AdListener; import com.amazon.device.ads.AdSize; public class AmazonAdsPlugin extends DroidGap implements AdListener { private Handler mHandler = new Handler(); private AdLayout adView; // The ad view used to load and display the ad. private static final String APP_KEY = "AppKey"; // Sample Application Key. Replace this variable with your Application Key private static final String LOG_TAG = "SimpleAdSample"; // Tag used to prefix all log messages /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/www/index.html"); LinearLayout linearLayout = new LinearLayout(this); linearLayout.setOrientation(LinearLayout.VERTICAL); ((ViewGroup) appView.getParent()).removeView(appView); adView = new AdLayout(this,AdSize.SIZE_300x50); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); lp.gravity= Gravity.BOTTOM; adView.setLayoutParams(lp); linearLayout.addView(adView); AdRegistration.enableLogging(true); AdRegistration.enableTesting(true); adView.setListener(this); try { AdRegistration.setAppKey(APP_KEY); } catch (Exception e) { Log.e(LOG_TAG, "Exception thrown: " + e.toString()); return; } linearLayout.addView(appView); setContentView(linearLayout); LoadAd(); } /** * Load a new ad. */ public void LoadAd() { // Load the ad with the appropriate ad targeting options. AdTargetingOptions adOptions = new AdTargetingOptions(); adView.loadAd(adOptions); } public void onAdCollapsed(AdLayout arg0) { // TODO Auto-generated method stub } public void onAdExpanded(AdLayout arg0) { // TODO Auto-generated method stub } public void onAdFailedToLoad(AdLayout arg0, AdError arg1) { //do something } public void onAdLoaded(AdLayout arg0, AdProperties arg1) { // TODO Auto-generated method stub } } /**** CODE ENDS HERE ****/ I am getting the following errors... The type AmazonAdsPlugin must implement the inherited abstract method AdListener.onAdCollapsed(Ad) AmazonAdsPlugin.java /AnimeAnimals/src/com/quantumrand/amazonAdsPlugin line 14 Java Problem The type AmazonAdsPlugin must implement the inherited abstract method AdListener.onAdDismissed(Ad) AmazonAdsPlugin.java /AnimeAnimals/src/com/quantumrand/amazonAdsPlugin line 14 Java Problem The type AmazonAdsPlugin must implement the inherited abstract method AdListener.onAdExpanded(Ad) AmazonAdsPlugin.java /AnimeAnimals/src/com/quantumrand/amazonAdsPlugin line 14 Java Problem The type AmazonAdsPlugin must implement the inherited abstract method AdListener.onAdFailedToLoad(Ad, AdError) AmazonAdsPlugin.java /AnimeAnimals/src/com/quantumrand/amazonAdsPlugin line 14 Java Problem The type AmazonAdsPlugin must implement the inherited abstract method AdListener.onAdLoaded(Ad, AdProperties) AmazonAdsPlugin.java /AnimeAnimals/src/com/quantumrand/amazonAdsPlugin line 14 Java Problem Please help...
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Draw2GO avatar image
Draw2GO answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt15@Amazon avatar image
Matt15@Amazon answered
Hey Draw2GO, The AdListener methods now take Ad objects as parameters instead of AdLayout objects. Each AdLayout is an instance of Ad, though, so you will likely be able to continue using the listener as you had been before. See the changes for version 5.3.9 on the Release Notes page for more information: https://developer.amazon.com/public/apis/earn/mobile-ads/docs/release-notes Matt
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.