Integrate BitLabs using our Android SDK

This article shows you how to integrate our Offer Wall, Direct Link Surveys or Direct Link with fixed Reward into your Android App.

1. Get your API Key

Sign up for a new developer account and create a new App. Copy your App Token to initiate the SDK.

2. Install the SDK

Dependencies
Add the following above the dependencies section of your app level build.gradle file:

repositories {
    maven {
        url "https://dl.bintray.com/bitburst/mobile"
    }
}

Then add the dependency to the same file:

dependencies {
    // other dependencies

    implementation 'ai.bitlabs:sdk:1.1.4'

    // other dependencies
}


3. Use the SDK

Initiate the SDK before you use it:

BitLabsSDK.init(<context>, "YOUR-TOKEN", "YOUR-USER-ID");
//Use BitLabsSDK.Companion.init() if you calling the SDK from a Java class

Call the .show() function to open the Offer Wall / Direct Link

BitLabsSDK.show(<context>);
//Use BitLabsSDK.Companion.show() if you calling the SDK from a Java class

Use .surveyAvailable() to check if a survey is available for the user

BitLabsSDK.surveyAvailable();
//Use BitLabsSDK.Companion.surveyAvailable() if you calling the SDK from a Java class


4. Set up your callbacks

Setting up callbacks can be done on the dashboard. Follow the instructions and examples in our Server to Server Callback Article to properly set up callbacks.