Skip to main content

Import and configure

  • If you are using the TradPlus SDK for the first time, we recommend that you use the Demo to understand the use of the SDK.

1、Add the SDK to the project#

TradPlus supports adding SDK to the project through gradle, and developers can obtain Gradle references through the TradPlusSDK download platform.

2、Update AndroidManifest.xml#

To update your AndroidManifest.xml, please complete the following steps::

<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="your package name"
xmlns:tools="http://schemas.android.com/tools">
<!-- Manifest Permissions -->
<!-- CSJ -->
<permission
android:name="${applicationId}.openadsdk.permission.TT_PANGOLIN"
android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.openadsdk.permission.TT_PANGOLIN" />
<!--CSJ、Pangle WAKE_LOCK permission is no longer required in version 4.2.5.2 and above -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- If your application targets API 31 or greater (Android 12) you must declare the AD ID permission: -->
<uses-permission android:name="android.permission.AD_ID" />
<application
<!-- Hardware Acceleration for Video Ads -->
android:hardwareAccelerated="true"
<!-- AndroidV 9.2 is written to the SDK, no configuration is required -->
<!-- Network Security Config -->
android:networkSecurityConfig="@xml/network_security_config">
<!-- Apache HTTP -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
</manifest>
  • In the res/xml/network_security_config.xml file, you can add localhost to the permitted cleartext traffic domain by adding::
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config
cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>

3、Proguard configuration#

  • If you are using ProGuard with the TradPlus SDK, you must add the following code to your ProGuard file
-keep public class com.tradplus.** { *; }
-keep class com.tradplus.ads.** { *; }

4、Initialize the SDK#

  • Initialize the SDK when an Application create:
TradPlusSdk.setTradPlusInitListener(new TradPlusSdk.TradPlusInitListener() {
@Override
public void onInitSuccess() {
// It is recommended to initiate an ad request after this callback
}
});
TradPlusSdk.initSdk(context, "TradPlus AppID");

5、Resource optimization#

If you introduce any third-party framework optimization resource, you need to add all the resources prefixed to the whitelist.

TradPlus#

R.string.tp_*
R.drawable.tp_*
R.layout.tp_*
R.id.tp_*

Integrated the cross-promotion#

R.string.cp_*
R.drawable.cp_*
R.layout.cp_*
R.id.cp_*

Integrated the Klevin#

R.anim.klevin_*
R.color.klevin_*
R.drawable.klevin_*
R.id.klevin_*
R.layout.klevin_*
R.mipmap.klevin_*
R.string.klevin_*
R.integer.klevin_*
R.style.klevin_*
R.dimen.klevin_*
R.xml.klevin_*

Integrated the Pangle#

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@layout/tt_*,
@layout/notification_*,
@anim/tt_*,
@drawable/tt_*,
@string/tt_*,
@color/tt_*,
@string/ad*,
@string/star_*,
@dimen/tt_*,
@integer/tt_*,
@style/tt_*,
@style/Theme.Dialog.TT_*,
@style/tt_*,
@style/quick_*,
@style/EditTextStyle*"
@attr/tt_*"/>
  • In addition, Pangle also needs to perform clear single resource configuration according to the connected Pangle version
  • DownLoad whiteList.txt

Integrated the GDT#

"R.integer.min_screen_width_bucket",
"R.style.DialogAnimationUp",
"R.style.DialogAnimationRight",
"R.style.DialogFullScreen",
"R.drawable.gdt_*"

Integrated the Mintegral#

"R.string.mbridge*",
"R.layout.mbridge*",
"R.drawable.mbridge*",
"R.anim.mbridge*",
"R.color.mbridge*",
"R.style.mbridge*",
"R.id.mbridge*"