Dash Stats Docs

Getting started

Integrate the AppBrain SDK in your app in 5 minutes, using these four simple steps:

1. Add Gradle dependency

In your project’s build.gradle file add:

repositories {
    maven {
        url 'http://swisscodemonkeys.github.io/appbrain-sdk/maven'
    }
}

dependencies {
    compile 'com.appbrain:appbrain-sdk:[email protected]'
}

2. Access your account

If you haven’t done so yet, create an AppBrain developer account to get access to the AppBrain developer dashboard and to register your app for the SDK.

3. Show ads

Show an interstitial ad with InterstitialBuilder, for example when the user completes a level in your game:

private InterstitialBuilder interstitialBuilder;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Preload the AppBrain interstitial. Settings the AdId is optional,
    // but highly recommended. You can also create a custom AdId for your
    // publisher app on our dashboard under "Ad settings".
    interstitialBuilder = InterstitialBuilder.create()
        .setAdId(AdId.LEVEL_COMPLETE)
        .setOnDoneCallback(new Runnable() {
            @Override
            public void run() {
                // Preload again, so we can use interstitialBuilder again.
                interstitialBuilder.preload(getContext());
                loadNextLevel();
            })
        .preload(this);
}

public void onLevelCompleted() {
    interstitialBuilder.show(this);
}

For more details and examples, see Ad unit overview.

You’re done! For more detailed instructions see SDK setup, or the rest of the AppBrain SDK help pages.