Initialize the TradPlus SDK
#
Step 1.PrerequisitesThis document mainly introduces how to integrate TradPlus SDK.
- The supported ad formats are: Native Ads、Banner Ads, Interstitial Ads, Rewarded Ads and Splash Ads
minSdkVersion
16 or latercompileSdkVersion
28 or later
#
Step 2.Import the TradPlus SDK- 1.Download the TradPlus Android SDK
- 2.Update your AndroidManifest.xml
- 3.Optionally use Proguard
- 4.Initialize the SDK
#
Option 1.Download the TradPlus Android SDK- 1.Enter the Packaging System of TradPlus SDK.Check the third-party ad platforms that need to be aggregated as shown below:
- 2.Apps can import the TradPlus SDK and the third-party SDK platforms with a Gradle dependency that points to the Packaging System of TradPlus SDK. Or select the Integrate to generate Gradle's integration code as shown below:
- 3.Select the SDK download link as shown below:
Download the SDK zip package.After decompression,the TradPlusSDK_Android folder will have the following contents:
- third-party_libs:You can obtain the SDK library files in this folder
- Use the androidX libraries:You can obtain the SDK library files about Pangle and Tencent GDT 's aar in this folder
- Use the original support libraries:You can obtain the SDK library files about Pangle , Tencent GDT and Vungle's aar in this folder
- res:Aggregate the resources that the third-party Network SDK must import
#
Option 2.Update your AndroidManifestSet the following permissions in your project's AndroidManifest.xml
:
#
1.Permission configuration#
2.Set Activity Definitions#
(1)If Mitegral China-Mainland is aggregated (Only Support AndroidX),the following configuration must be added to AndroidManifest.xmlThat mb_provider_paths.xml
has been written into the three-party aar resource package
#
(2)If Admob is aggregated, the following configuration must be added to AndroidManifest.xml (you can find your app ID in the AdMob UI).For details,update_your_androidmanifest
#
(3)If Applovin is aggregated, the following configuration must be added to AndroidManifest.xml (you can find your SDK Key in the AppLovin).For details,Where to get the AppId or SDK Key
#
(4)If Tencent GDT is aggregated, the following configuration must be added to AndroidManifest.xmlThat gdt_file_path.xml
has been written into the three-party aar resource package
#
(5)If Smaato is aggregated, your application targets Android 5.0 (API level 21) or higher, then you need to add the following line to your application AndroidManifest.xml file:For details,Smaato integration
#
(6)If Kuaishou is aggregated, the following configuration must be added to AndroidManifest.xml#
(7)If YouDao is aggregated, the following configuration must be added to AndroidManifest.xmlThat ad_download_paths.xml
has been written into the three-party aar resource package
#
(8)If Joomob is aggregated, the following configuration must be added to AndroidManifest.xmlThat uniplay_file_path.xml
has been written into the three-party aar resource package
#
3.Android 9 Adaptation(1)added the following configuration in AndroidManifest.xml:
(2)Add a network security configuration file
The Network Security Configuration feature uses an XML file where you specify the settings for your app.
If you haven't done so, under the xml
folder of the app resources, you can create a new XML file: res/xml/network_security_config.xml
.
Then in your application manifest AndroidManifest.xml
, add the configuration to your application attribute as follows:
For more details regarding the Network security configuration, please see the official Google documentation
In the res/xml/network_security_config.xml
file, you can add localhost to the permitted cleartext traffic domain by adding:
#
Option 3.ProGuard ConfigurationAdd the following to your ProGuard configuration:
#
Option 4.Initialize the SDKYou can initialize the TradPlus SDK in your Application:
You can get "APPID" , as shown below: