Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

These instructions give an overview of integrating the MobileFuse SDK with your Android app.

Current Version

...

Integration Steps Overview

Table of Contents
minLevel2
maxLevel2

You can also use the MobileFuse SDK with our supported mediation platforms.

Step 1. Download the MobileFuse Android SDK

The MobileFuse SDK is distributed on Maven Central and we recommend including the SDK into your project using Gradle.

Gradle Setup

1- Ensure that mavenCentral is included in your settings.gradle file:

Code Block
languagejava
repositories {
    // [... other project repos]
    mavenCentral()
}

2- Update your app module’s dependencies to include the MobileFuse SDK:

Code Block
dependencies {
    // [... other project dependencies]
    implementation 'com.mobilefuse.sdk:mobilefuse-sdk-core:1.3.0'
}

Expand
titleAdditional steps - if things aren't working as expected after adding the MobileFuse SDK dependency:

Ensure that your project includes Java 8 language support - our SDK requires support for this language level.

Code Block
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Step 2. Configure Data Privacy

Excerpt
nameconfigure-data-privacy

The MobileFuse SDK supports privacy configurations that can be managed using an IAB compatible US Privacy String, and IAB Consent Framework strings for GDPR. You can also notify the SDK whether your user subject to COPPA, due to them being under 13 years of age.

The following snippet demonstrates configuration for the US privacy and COPPA compliance:

Code Block
languagejava
MobileFusePrivacyPreferences privacyPrefs = new MobileFusePrivacyPreferences.Builder()
    .setSubjectToCoppa(false) // should be true if user is under 13 years of age
    .setUsPrivacyConsentString("<US Privacy String>") // e.g. 1YNN
    .build();

MobileFuse.setPrivacyPreferences(privacyPrefs);

GDPR for European users

For your European users, you must supply an IAB-compatible privacy consent string. The following example shows how to declare consent for a user which is subject to GDPR due to being located in an EAA country. Note that this can simply be chained to the same MobileFusePrivacyPreferences.Builder() as above.

Code Block
languagejava
MobileFusePrivacyPreferences privacyPrefs = new MobileFusePrivacyPreferences.Builder()
    .setIabConsentString("<IAB Consent String>")
    .build();

MobileFuse.setPrivacyPreferences(privacyPrefs);
Info

To ensure that you get reliable ad fill and the best CPMs, please ensure that you implement the data privacy methods that are relevant to your user.

Step 3. Initialize the SDK

To initialize the SDK, you’ll need to provide a valid App ID.

Info

If you don’t have an App ID for the SDK, please ask your MobileFuse contact. You’ll be given a unique App ID for each app and each platform that you publish to.

The following code snippet demonstrates a simple SDK initialization. Implementation of the init callback listener is optional, but the ‘success’ callback is a good place to set up the ad units for your app.

Code Block
languagejava
int publisherId = 0000;
int appId = 00000;

MobileFuse.init(this, publisherId, appId, new SdkInitListener() {
    @Override
    public void onInitSuccess() {
        // SDK is initialized. You can proceed with creating ad instances
        // and loading ads
    }

    @Override
    public void onInitError() {
        // SDK failed to initialize - for example no network connection or invalid app ID
    }
});

Step 4. Create Ad Units

Once the SDK has initialized, you can start using MobileFuse ad units. The following guides provide steps to get started with each of our supported ad formats:

...

Interstitial Ad

...

Banner Ad

...

This page has moved to our new documentation:

...