Android Question Need help with Chartboost and Admob using MoPub

Chris_MobileApp

Member
Licensed User
Longtime User
HI all...Its my first time using B4A.I am facing this problem. Please help.Would really appreciate.
I have followed the guide (pdf file) to integrate mopub. I want Admob banner and Chartboost Interstetial in my game. Can some please help with this?(I have uncomment the chartboost from xml file as given in pdf file)
Below is my manifest..

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

'AdMob
AddApplicationText(<!-- MoPub -->
<activity android:name="com.mopub.mobileads.MoPubActivity"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidActivity"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.common.MoPubBrowser"
android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
android:configChanges="keyboardHidden|orientation"/>
<!-- Google Play Services -->
<meta-data android:name="com.google.android.gms.version"
android:value="[USER=21225]@Integer[/USER]/google_play_services_version" />
<!-- AdMob -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
)
'AddApplicationText(<activity android:name="com.google.ads.AdActivity")
'AddApplicationText(android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|smallestScreenSize|screenSize"/>)
'AddApplicationText(
')
'End of AdMob




And here below is my script in game.


B4X:
ads.AdMob_Test
    ads.InitializeMopub_Banner("banner", "mopub_banner")
    ads.InitializeMopub_Interstitial("interstitial", "YOUR_MOPUB_INTERSTITIAL_ID")
    Activity.AddView (ads, 0, 0, 320dip, 50dip)
    ads.LoadMopub_Banner

    ads.PreloadMopub_Interstitial

Where to add chartboost and admob ids? Any help would be really appreciated.I know I have to use ads.ShowMopub_Interstitial for showing add where i want.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Please use code tags when posting code or manifest-data
 
Upvote 0
Top