-
Notifications
You must be signed in to change notification settings - Fork 1
Android Project Setup
-
You can download our SDK with all required libraries here.
-
Unzip the archive to your app library folder (example: my_project\app\libs)
-
Add all unzipped libraries in your app Gradle file (how to do that: read more)
-
Add play-services-ad, appcompat-v7 and recyclerview libraries to your project:
dependencies { compile 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:recyclerview-v7:26.1.0' compile 'com.google.android.gms:play-services-ads:15.0.1' }
Our Single SDK is composite of all top demand partner SDK’s and as a result, contains a lot of different libraries which requires multidex feature. You can learn more about multidex and how to enable it here.
Most of manifest settings will be added automatically by the Gradle manifest merger and following manifest elements need to add manually. Add elements that are between '<!-- Appmediation -->' comments.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name">
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Appmediation -->
<!-- Mobvista -->
<receiver android:name="com.mintegral.msdk.click.AppReceiver"
android:enabled="@bool/isLessThenApi28" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<!-- StatApp -->
<receiver android:name="com.startapp.android.publish.common.metaData.BootCompleteListener">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- Appmediation -->
</application>
</manifest>
P.S: Since not all our partners support encripted comunication we recomend to enabling cleartext in your application. To do that please add android:usesCleartextTraffic="true"
to you application in your manifest file.
P.S: If you are using AdMob version 17.0.0 or higher then you are required to specify a <meta-data>
tag with key com.google.android.gms.ads.APPLICATION_ID
in your AndroidManifest.xml
. Example:
<manifest>
<application>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ADMOB_APP_ID"/>
</application>
</manifest>
P.S: If you are not using Gradle build system then please replace the ${applicationId}
with your application package name.
By the release of Android API 28 (9.0 - Pie), Google started blocking non-HTTPS traffic by default. Even though Appmediation SDK uses only HTTPS traffic, some of our partner libraries still use HTTP traffic.
Please add the line below to your AndroidManifest.xml to ensure that ads are being served correctly:
<manifest>
<application>
...
android:networkSecurityConfig="@xml/network_security_config"
...
</application>
</manifest>
And in your network_security_config.xml, add the configuration to allow HTTP traffic:
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>