I'm having trouble with the integration steps from MoPub:
At this point I'm confused because I already input my appID and appSignature into MoPub's dashboard. I removed Chartboost.startWithAppId(this, appId, appSignature); and only kept onCreate but MoPub's ChartboostInterstitial class is still being marked as unused. This doesn't seem right.
Any ideas? MoPub's documentation in this area seems unclear.
Steps you need to do:
ChartboostInterstitial.java
and ChartboostShared.java
to your project's app/src/main/java/com/mopub/mobileads/
libs/
and add play-services-ads:8.4.0 as dependencies. Download the Chartboost SDK jar here.Check that you have added all libraries needed, all Activity
and required permissions declared in AndroidManifest.xml
.
AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application>
<activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.common.MoPubBrowser" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.RewardedMraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.chartboost.sdk.CBImpressionActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
</application>
If you use Gradle, your build.gradle
dependencies should probrably look like this:
dependencies {
// ... other project dependencies
// Compile the chartboost.jar in libs/
compile fileTree(dir: 'libs', include: ['*.jar']
// Google Play Services
compile 'com.google.android.gms:play-services-ads:8.4.0
//MoPub
compile('com.mopub:mopub-sdk:4.12.0@aar') {
transitive = true
}
compile('com.mopub:mopub-sdk-interstitial:4.12.0@aar') {
transitive = true
}
compile 'com.mopub.volley:mopub-volley:1.1.0'
compile 'com.android.support:support-v4:22.0.+'
compile 'com.android.support:support-annotations:22.0.+'
compile 'com.android.support:recyclerview-v7:22.0.+'
}