package mopublibfull;
import android.content.Intent;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.objects.ViewWrapper;
import com.mopub.mobileads.MoPubView;
import com.mopub.mobileads.Global;
@BA.ActivityObject
@BA.Author ("Johnmcenroy")
@BA.Version(1.0F)
@BA.Permissions(values={"android.permission.INTERNET","android.permission.ACCESS_NETWORK_STATE","android.permission.ACCESS_COARSE_LOCATION"})
@BA.DependsOn (values={"mopub-sdk","android-support-v4"})
@BA.ShortName("MopubAds")
public class MoPubLibFull extends ViewWrapper<MoPubView> {
/**
* // Enter your Banner Ad Unit ID from [url=http://www.mopub.com]MoPub - World's Largest Mobile Ad Server and RTB Exchange for iOS and Android[/url]
*/
public void InitializeMopub_Banner(BA ba , String adUnitId)
{
setObject(new MoPubView(ba.context));
((MoPubView)getObject()).setAdUnitId(adUnitId);
((MoPubView)getObject()).loadAd();
}
/**
* // Destroys MoPub Banner Ads
*/
public void DestroyMopub_Banner(BA ba)
{
((MoPubView)getObject()).destroy();
}
/**
* // Enter your Interstitial Ad Unit ID from [url=http://www.mopub.com]MoPub - World's Largest Mobile Ad Server and RTB Exchange for iOS and Android[/url]
*/
public Intent ShowMopub_Interstitial(BA pBA, String AdUnitID){
Intent intent1 = new Intent(pBA.activity,MoPubLibFullInt.class);
intent1.putExtra("AdUnitID", AdUnitID);
return intent1;
}
/**
* // Enter your TapForTap API
* <b>USE BEFORE InitializeMopub_Banner !</b>
* Don't forget to add Custom Native Network in MoPub Console , class name - com.mopub.mobileads.TapForTapBanner
*/
public void AddToMopub_Tapfortap_Banner (BA ba , String TapAPI)
{
Global.TapAPIba = TapAPI;
}
}