Android SDK Installation

Pre-requisites

  1. Android Studio version 2023.2.1 (Iguana) or newer
  2. Gradle version 8.2.0 or newer
  3. Obtain client settings from Publift:
    • TENANT_CODE
    • TAG_ID
    • GADApplicationIdentifier

Installation

  1. Request access to the Publift Maven repository
  2. Add the following lines to your build.gradle file:
// Add the Publift maven repository.
dependencyResolutionManagement {
    repositories {
        ...
        maven("https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/")
    }
}
    
// Add FuseAppSDK as a dependency.
dependencies {
    implementation 'com.publift.fuseappsdk:fuseappsdk:1.1.0'
}
  1. In Android Studio, select the menu item “File > Sync Project With Gradle Files”.

SDK Configuration

Add the following entries to the file AndroidManifest.xml in your Android project:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application ... >
        
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="(PROVIDED-VALUE)" />
        <meta-data
            android:name="com.publift.mobile.TENANT_CODE"
            android:value="(PROVIDED-VALUE)" />
        <meta-data
            android:name="com.publift.mobile.TAG_ID"
            android:value="(PROVIDED-VALUE)" />
            
        ...
    </application>
</manifest>

The value for each setting wil be provided to you by Publift.

If your app launches using a main Application class, add the following code to it:

import com.publift.fuseappsdk.FuseSDK

class MyApplication : Application() {
    
    override fun onCreate() {
        super.onCreate()
        FuseSDK.init(this)
        ...
    }
    
}

Alternatively, if your app launches using a main Activity class, add the following code to it:

import com.publift.fuseappsdk.FuseSDK

class MyActivity : ComponentActivity() {
    
    override fun onCreate() {
        super.onCreate()
        FuseSDK.init(application)
        ...
    }
    
}