ImportAtmosplayAdsSDK - Atmosplay/AtmosplayAds-Android GitHub Wiki

Android Studio

First Step: Add dependencies and permissions

a.Add following codes in build.gradle file of project

dependencies {
    implementation 'com.atmosplayads:atmosplayads:3.2.1'
}

b. add permissions into AndroidManifest

<!-- Required for China-Mainland Traffic app -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Second Step: Sync Project

Click "Sync Project with Gradle Files" button on the Android Studio's menu bar to download dependence files.

Eclipse

First Step: Import SDK jar

Import atmosplayads-3.1.0.jar into the Eclipse project's libs, and configure the build path, the main steps as follows,

  1. Right click the project on Eclipse, select Build Path and Configure Build Path...;
  2. Chooses Libraries table, click Add JARs... button;
  3. Select the jar file.

also need move assets resources to your project assets directory.

Second Step: Regitsters AtmosplayAds SDK componets

Registers necessary componets into AndroidManifest

  1. permissions
<!-- required permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Required for China-Mainland Traffic app -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<!-- optional permissions -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
  1. activity and receiver
<activity
    android:name="com.atmosplayads.presenter.AtmosplayAdActivity"
    android:configChanges="orientation|screenSize|keyboardHidden"
    android:hardwareAccelerated="true"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity
    android:name="com.atmosplayads.presenter.NativeAdLandingPageActivity"
    android:configChanges="orientation|screenSize|keyboardHidden"
    android:hardwareAccelerated="true"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity
    android:name="com.atmosplayads.presenter.WebActivity"
    android:configChanges="orientation|screenSize|keyboardHidden"
    android:hardwareAccelerated="true"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

<receiver android:name="com.atmosplayads.AtmosplayAdsReceiver" >
    <intent-filter>
        <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
    </intent-filter>
</receiver>

Add the MSA SDK to your app

To enable the Atmosplay SDK can to read OAID values using the MSA SDK, copy the MSA SDK (AAR file) to the libs directory of your project and set the dependency. You also need to copy the supplierconfig.json to the assets directory of your project.

You can find the MSA SDK and detailed instructions here.

Important:Required for China-Mainland Traffic app. If you do n’t add it will affect the advertising revenue, Googleplay can not add it.

Proguard

If the project need to be proguarded, put the following code into the proguard.pro file.

# AtmosplayAds
-keep class com.atmosplayads.**{*;}

GetDemo

⚠️ **GitHub.com Fallback** ⚠️