ImportAtmosplayAdsSDK - Atmosplay/AtmosplayAds-Android GitHub Wiki
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" />
Click "Sync Project with Gradle Files" button on the Android Studio's menu bar to download dependence files.
Import atmosplayads-3.1.0.jar into the Eclipse project's libs, and configure the build path, the main steps as follows,
- Right click the project on Eclipse, select Build Path and Configure Build Path...;
- Chooses Libraries table, click Add JARs... button;
- Select the jar file.
also need move assets resources to your project assets directory.
Registers necessary componets into AndroidManifest
- 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"/>
- 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>
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.
If the project need to be proguarded, put the following code into the proguard.pro file.
# AtmosplayAds
-keep class com.atmosplayads.**{*;}