Android SDK Installation
Pre-requisites
- Android Studio version
2023.2.1
(Iguana) or newer - Gradle version
8.2.0
or newer - Obtain client settings from Publift:
TENANT_CODE
TAG_ID
- Google
APPLICATION_ID
Installation
- Request access to the Publift Maven repository
- Add the following lines to your
settings.gradle
file:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url = uri("https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/maven/") }
}
}
- Add the following lines to your
build.gradle
file:
dependencies {
implementation 'com.publift.fuseappsdk:fuseappsdk:<latest_version>'
}
You can find out the latest version of Fuse App SDK here.
- 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)
...
}
}