Getting Started

The SDK supports Android with minSdkVersion 21 or newer and requires compileSdkVersion 32 or above.

Note: Every AndroidX library is compiled with API 31, so the SportBuff SDK matches this standard.


SDK Integration

Gradle Setup

Add the following to your root build.gradle at the end of repositories:

allprojects {
  repositories {
    ...
    maven { url '<https://jitpack.io>' }
  }
}

Then, add this line to your build.gradle file:

implementation 'com.github.buffup:Android:v5.0.1'

Using the SDK

Add the following line to your Application class to initialize the SDK:

BuffSdk.initialize(
    context = <APPLICATION_CONTEXT>,
    clientAccount = <CLIENT_NAME>,
    anonymousLogin = <BOOLEAN>,
    enableDebugMode = <BOOLEAN>,
    tvMode = <BOOLEAN>,
    qrCodeVisibleDuration = <INTEGER>,
    qrCodeVisibleFrequency = <INTEGER>
)

SDK Properties

Property Description
context Context of the application.
clientAccount Unique string identifier for your account.
anonymousLogin Enables anonymous login.
enableDebugMode Enables debug logs.
tvMode Indicates SDK usage for Android TV (default: false).
qrCodeVisibleDuration Duration (in seconds) for QR code display on screen (TV Mode only).
qrCodeVisibleFrequency Frequency (in seconds) for QR code display on screen (TV Mode only).

User Login (Optional)

To manually login a user, use the following method with a SportBuff authentication token:

fun signInUser(token: String)