logo

Help Center/Details/

Integrate Pangle SDK for Android

This guide is for publishers who want to monetize an Android app with the traffic outside of china.

Environment requirement

  • minSdkVersion 14 and higher
  • targetSDKVersion 28 and higher
  • compileSdkVersion 29 and higher
  • gradleVersion required as below

gradle (1).png

Import Pangle SDK

Apps can import the Pangle SDK with a Gradle dependency. First, make sure that JCenter is referenced in the allprojects section of your project-level build.gradle file.

Example project-level build.gradle (excerpt)

allprojects {
    repositories {
        jcenter()
    }
}

Next, open the app-level build.gradle file for your app, and look for a "dependencies" section.

dependencies {
    implementation 'com.bytedance.sdk:pangle-sdk:3.4.1.1'
}

Add the line in bold above, which instruct Gradle to pull in the Pangle SDK and additional related dependencies. Once that's done, save the file and perform a Gradle sync.

Update your AndroidManifestl.xml

Add the required permissions to your app's AndroidManifest.xml file, as shown below.

<!--Required  permissions-->
<uses-permission android:name="android.permission.INTERNET"  data-tomark-pass />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"  data-tomark-pass />

<!-- If there is a video ad and it is played with textureView, please be sure to add this, otherwise a black screen will appear -->
<uses-permission android:name="android.permission.WAKE_LOCK"  data-tomark-pass />

Add the TTMultiProvider to your app's AndroidManifest.xml file by adding a <provider data-tomark-pass=""> tag, as shown below:</provider>

<manifest data-tomark-pass >
    <application data-tomark-pass >
        <!-- add the provider between the application tag -->
        <provider    
android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"   android:authorities="${applicationId}.TTMultiProvider"   android:exported="false"  data-tomark-pass />
    </application>
</manifest>

  

Obfuscation

If you need to use proguard to obfuscate your code, be sure not to obfuscate the SDK code. Please add the following configuration at the end of the proguard.cfg file (or other obfuscated files):

-keep class com.bytedance.sdk.openadsdk.** { *; }
Did the content solve your problem?