Important: As an App developer, as the controller of data, you must ensure that you have received unambiguous and informed consent from a user before sharing any of their data with Leadbolt or before calling any Leadbolt SDK functions for that user. Please ensure your app is updated as required.


Before you begin Before you begin

  • Have you logged in to the Leadbolt Publisher Portal?
  • Did you add an App in the portal?
  • Ensure, you have downloaded the Leadbolt SDK and sample app from the link above
  • Add the required permission android.permission.INTERNET in your AndroidManifest.xml file
  • Add the required permission android.permission.ACCESS_NETWORK_STATE in your AndroidManifest.xml file
  • To ensure your App is compatible with Android 6.0 and above devices, set the project’s Build and Compile SDK Version to API Level 25 or above in your build.gradle file

    compileSdkVersion = 25
    buildToolsVersion = '25.0.3'
  • Also set the Target SDK Version in your App’s AndroidManifest.xml file to 23 or higher to target Android 6.0 features


Step 1 Add Leadbolt SDK Jar file

  • Copy the downloaded AppTracker.jar file to your Android Project’s “libs” folder. If folder doesn’t exist, create one and add the jar file to it

Step 2 Add Google Play Services

  • The Google Play services are needed to be added in your App to enable the Leadbolt SDK to use the Google Advertising ID.
  • Follow the setup instructions from Google to include the library in your App. If you are using Google Play services v12.0.0 or higher, you will need to set the dependencies as play-services-base and play-services-ads-identifier, while older Google Play Services version need the dependency play-services-ads

Step 3 Add Leadbolt SDK Imports

  • Add the following Leadbolt SDK import statements to all your App’s Activities that will use the Leadbolt SDK.

Step 4 Initialize Leadbolt SDK

  • In your App’s launcher Activity, add the following code to your Activity’s onCreate method.

    You will need to replace "YOUR_APP_API_KEY"  with the specific api key for your app (include the double quotes).

Step 5 To fetch a Native Ad

Step 6 To show a Native Ad

  • Use the onAdsLoaded method in the ATNativeListener class to get notified

Step 7 Obfuscating your App with ProGuard

If you are using ProGuard to obfuscate your release APK file, please add the following lines of code to your proguard configurations:

Test Integration Test your Integration

  • Run your Project on an Android device.
  • Ensure, test ads are displayed when the “loadModule” call is made in your App.
  • Once test ads are seen on your device, go to your Leadbolt Portal and set your App to “Live”
  • Once approved, you should see live ads in your App.

Congratulations! You have successfully integrated the Leadbolt SDK in your App


  • If you are looking to implement Native Ads without templates please visit this page
  • Native Ads may not be available at all times in all countries. It is always best to test with your App in Test Mode in the Publisher Portal as Test Ads are generally always available.
  • You should check your Publisher Portal and ensure the relevant native ad section is visible under your App. Use the “Add Section” button to add if not available.
  • You should check the SDK logs located in Logcat logs with the Tag “AppTracker”.
  • Always test the native sample app provided to confirm any integration issues are SDK based.
  • The SDK has been tested to be compatible with Android Studio Version 3.1.3

Advanced Integration

Pass Additional Info Passing Additional Information

You can increase your App’s performance by optionally including the additional information below. This allows selected premium advertisers to display their Ads to your users. To pass this additional information, use the following methods BEFORE calling loadModuleToCache

Event Listeners Using Event Listeners

With Event listeners, you can closely follow the ad states throughout your App. Leadbolt SDK will trigger events at all important stages of the Ad life-cycle. To implement event listeners in your App, you must implement the ATNativeListener class.

Setup SDK to use Event Listeners

Before using any of the Event Listener methods, you will need to initialize your Event Listener object in your Project like so:

Now, set AppModuleListener in your onCreate method BEFORE calling AppTracker.startSession() like so:

Event Listener Methods


← Return to Help Center