use of com.mopub.common.SdkConfiguration in project prebid-mobile-android by prebid.
the class RubiconRewardedVideoMoPubDemoActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo);
PrebidMobile.setPrebidServerHost(Host.RUBICON);
PrebidMobile.setPrebidServerAccountId(Constants.PBS_ACCOUNT_ID_RUBICON);
PrebidMobile.setStoredAuctionResponse(Constants.PBS_STORED_RESPONSE_VAST_RUBICON);
VideoBaseAdUnit.Parameters parameters = new VideoBaseAdUnit.Parameters();
parameters.setMimes(Arrays.asList("video/mp4"));
parameters.setProtocols(Arrays.asList(Signals.Protocols.VAST_2_0));
// parameters.setProtocols(Arrays.asList(new Signals.Protocols(2)));
parameters.setPlaybackMethod(Arrays.asList(Signals.PlaybackMethod.AutoPlaySoundOff));
// parameters.setPlaybackMethod(Arrays.asList(new Signals.PlaybackMethod(2)));
RewardedVideoAdUnit adUnit = new RewardedVideoAdUnit("1001-1");
adUnit.setParameters(parameters);
this.adUnit = adUnit;
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder(Constants.MP_ADUNITID_REWARDED).build();
MoPub.initializeSdk(this, sdkConfiguration, null);
MoPubRewardedVideos.setRewardedVideoListener(this);
final Map<String, String> keywordsMap = new HashMap<>();
adUnit.fetchDemand(keywordsMap, new OnCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
MoPubRewardedVideoManager.RequestParameters parameters = new MoPubRewardedVideoManager.RequestParameters(Util.convertMapToMoPubKeywords(keywordsMap));
MoPubRewardedVideos.loadRewardedVideo(Constants.MP_ADUNITID_REWARDED, parameters, (MediationSettings) null);
}
});
}
use of com.mopub.common.SdkConfiguration in project prebid-mobile-android by prebid.
the class TestResultsActivity method initMoPub.
private void initMoPub(String adUnitId) {
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder(adUnitId).build();
MoPub.initializeSdk(this, sdkConfiguration, this::runTests);
}
use of com.mopub.common.SdkConfiguration in project prebid-mobile-android by prebid.
the class XandrNativeInAppMoPubDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo);
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder("2674981035164b2db5ef4b4546bf3d49").withLogLevel(MoPubLog.LogLevel.DEBUG).build();
MoPub.initializeSdk(this, sdkConfiguration, null);
loadInAppNativeMopub();
}
use of com.mopub.common.SdkConfiguration in project prebid-mobile-android by prebid.
the class CustomApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
// init MoPub SDK
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder("a935eac11acd416f92640411234fbba6").build();
MoPub.initializeSdk(this, sdkConfiguration, null);
// set Prebid Mobile global Settings
// region PrebidMobile API
PrebidMobile.setShareGeoLocation(true);
PrebidMobile.setApplicationContext(getApplicationContext());
// endregion
if (BuildConfig.DEBUG) {
sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
this.registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
activity.getWindow().addFlags(FLAG_TURN_SCREEN_ON | FLAG_SHOW_WHEN_LOCKED | FLAG_KEEP_SCREEN_ON);
}
@Override
public void onActivityStarted(Activity activity) {
}
@Override
public void onActivityResumed(Activity activity) {
}
@Override
public void onActivityPaused(Activity activity) {
}
@Override
public void onActivityStopped(Activity activity) {
}
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
}
@Override
public void onActivityDestroyed(Activity activity) {
}
});
}
}
Aggregations