Here is the new adapter:
import android.app.Activity;
import android.util.Log;
import android.view.View;
import com.adwhirl.AdWhirlLayout;
import com.adwhirl.AdWhirlLayout.AdWhirlInterface;
import com.inneractive.api.ads.InneractiveAdEventsListener;
import com.inneractive.api.ads.InneractiveAdView;
import com.inneractive.api.ads.InneractiveAdComponent;
public class InnerActiveCustomEvents implements AdWhirlInterface {
private static final String INNERACTIVE_PUBLISHER_ID = "TBD";
private AdWhirlLayout mAdWhirlLayout;
private Activity mActivity;
public AdWhirlMultipleCustomEvents(AdWhirlLayout mAdWhirlLayout, Activity mActivity) {
super();
this.mAdWhirlLayout = mAdWhirlLayout;
this.mActivity = mActivity;
}
public void adWhirlGeneric() {
}
public void inneractiveBanner() {
// BUGBUG - This fixes the Android OS bug with 'getCacheTotalSize' which causes
// NullPointerException prior to Android 2.3, see also:
// http://code.google.com/p/android/issues/detail?id=10789
android.webkit.WebViewDatabase webViewDB = android.webkit.WebViewDatabase.getInstance(mActivity);
if (webViewDB == null) {
mAdWhirlLayout.rollover();
return;
}
InneractiveAdView banner = InneractiveAdComponent.getAdView(mAdWhirlLayout.getContext(), INNERACTIVE_PUBLISHER_ID, InneractiveAdComponent.BANNER_AD_TYPE, 0);
banner.setListener(new InneractiveAdEventsListener() {
@Override
public void onReceiveAd(InneractiveAdView adView) {
adView.setVisibility(View.VISIBLE);
Log.v("InnerActive Banner Listener", "Received Ad.");
mAdWhirlLayout.handler.post(new AdWhirlLayout.ViewAdRunnable(mAdWhirlLayout, adView));
mAdWhirlLayout.adWhirlManager.resetRollover();
mAdWhirlLayout.rotateThreadedDelayed();
}
@Override
public void onFailedToReceiveAd(InneractiveAdView adView) {
Log.v("InnerActive Banner Listener", "Failed To Receive Ad.");
mAdWhirlLayout.rollover();
}
@Override
public void onClickAd(InneractiveAdView adView) {
}
});
}
}
2 comments:
thanks, that is what i was looking for... i use it now for mob fox and interactive..
BUT one problem i have... often i get the ads in a MINI Size.. first i thought its just with interactive... but when i included also mobfox in that CustomEvent.... also they often appear MINI ... like 20% size centered in the middle.. what could that be (would be great you can answer to my email also)
greets
chris
@Christian - you might want to try adding 'android:anyDensity="false"' to your manifest.
I remember the old innerActive SDK had this problem, but I haven't encountered it in the latest version.
Post a Comment