Getting Started - Android
  • 10 Feb 2026
  • 18 Minutes to read
  • Contributors
  • Dark
    Light

Getting Started - Android

  • Dark
    Light

Article summary

# Getting Started - Android

Getting Started with Tickets SDK for Android

This guide walks you through integrating the Ticketmaster Tickets SDK into your Android application. By the end of this guide, you'll have the SDK installed and displaying tickets in your app.

Prerequisites

Before you begin, ensure you have:

  • Android API 28+ (minSdk)

  • Kotlin 1.9+

  • Ticketmaster API Key

Note: The SDK uses Jetpack Compose internally. Your app does not need to use Compose, but the SDK's fragments include Compose-based UI.


What You'll Build

In this guide, you'll:

  1. Add the SDK dependencies to your project

  2. Initialize the SDK in your Application class

  3. Configure Authentication SDK (required dependency)

  4. Configure Tickets SDK with branding

  5. Display the tickets view in your app

  6. Verify your integration


Step 1: Configure SDK

The Tickets SDK consists of three components that work together:

  • tickets - Main Tickets SDK (includes Authentication SDK)

  • authentication - User login and token management

  • secure-entry - Secure barcode rendering (SafeTix, QR codes)

1.1 Add JitPack Repository

In your project-level settings.gradle.kts (or settings.gradle):

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

Or in your project-level build.gradle (legacy):

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

1.2 Add SDK Dependencies

In your app-level build.gradle.kts:

dependencies {
    // Ticket Master Tickets SDK
    implementation("com.ticketmaster.tickets:tickets:X.X.X")
}

Or toml versions file:

dependencies {
    // Tickets SDK 
    implementation(libs.ticketmaster.tickets)
}
[versions]
ticketmaster-tickets = "X.X.X"
[libraries]
ticketmaster-tickets = { module = "com.ticketmaster.tickets:tickets", version.ref = "ticketmaster-tickets" }

Note: Check the Android Change Log for the latest version numbers.

1.3 Add API Key, Team Name and Team Colors

Add your API key , Team Name and Colors to local.properties (don't commit this to source control):

config.consumer_key = consumer_key
config.team_name = tem_name 
config.branding_color= #color

Reference it in your build.gradle.kts:

android {
    defaultConfig {
         if (rootProject.file("local.properties").exists()) {
                val properties = Properties().apply {
                    rootProject.file("local.properties").inputStream().use { load(it) }
                }

                // Tickets SDK Setup
                val consumerKey = properties["config.consumer_key"] as String?
                val teamName = properties["config.team_name"] as String?
                val brandingColor = properties["config.branding_color"] as String?

                println("branding color: $brandingColor")

                buildConfigField("String", "CONSUMER_KEY", "\"$consumerKey\"")
                buildConfigField("String", "TEAM_NAME", "\"$teamName\"")
                buildConfigField("String", "BRANDING_COLOR", "\"$brandingColor\"")

            }
    }
    buildFeatures {
        buildConfig = true
    }
}

1.4 Add Login Screen and URL Scheme to Manifest

If using Modern Accounts, (Host, Archtics or MicroFLex) add “ModernAccountsLoginScreen”:

<activity
            android:name="com.ticketmaster.authenticationsdk.internal.modernaccounts.presentation.ModernAccountsLoginScreen"
            android:exported="true"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- YOUR SCHEME will be provided in your app settings, copy it to this location -->
                <data android:scheme="[your scheme here]" />
            </intent-filter>
        </activity>

If using SportXR, add “SportXRLoginScreen”:

 <activity
            android:name="com.ticketmaster.authenticationsdk.internal.sportxr.presentation.SportXRLoginScreen"
            android:exported="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <!-- YOUR SCHEME will be provided in your app settings, copy it to this location -->
                <data android:scheme="[your scheme here]" />
                <data android:host="login" />
            </intent-filter>
        </activity>

Note: You can find your url scheme in your API key team settings.

1.5 Sync and Build

After adding dependencies:

  1. Click Sync Now in Android Studio

  2. Build the project to verify dependencies resolve correctly


Step 2: Initialize SDK Singleton

The Tickets SDK requires initialization in your Application class before any other SDK calls.

2.1 Create Application Class (If not previously created)

If you don't have an Application class, create one:

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        // REQUIRED: Initialize SDK singleton
        TicketsSDKSingleton.init(this)
    }
}

2.2 Register in AndroidManifest.xml

<application
     android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:theme="@style/Theme.YourTheme"
        tools:replace="android:theme"

    <!-- Your activities -->

</application>

2.3 Alternatively, Initialize TicketsSDKSingleton in your Activity (Not recommended)

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        TicketsSDKSingleton.init(this.application)
        setContentView(R.layout.activity_main)
    }
}

Important: You must call TicketsSDKSingleton.init() before using any other SDK methods. Failing to do so will result in runtime crashes.


Step 3: Configure Authentication SDK

The Tickets SDK depends on Authentication SDK for user login and API access. You must configure Authentication SDK before configuring Tickets SDK.

3.1 Build Authentication Client

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        setupAuthenticationSDK()
    }

    private fun setupAuthenticationSDK() {
        lifecycleScope.launch {
            createTMAuthenticationBuilder().build(this@MainActivity)
                .fold(
                    onSuccess = { authentication ->
                        //after succesfully setting up Authentication, launch Tickets SDK
                        setupTicketsSDKClient(authentication)
                    },
                    onFailure = {
                        //Custom Logic for failure
                    }
                )
        }
    }
   
    private fun createTMAuthenticationBuilder(): TMAuthentication.Builder =
        TMAuthentication.Builder(
            // Your consumer key
            apiKey = BuildConfig.CONSUMER_KEY,
            // Team name to be displayed
            clientName = BuildConfig.TEAM_NAME
        ) 
            .region(TMXDeploymentRegion.US) // Region that the SDK will use. Default is US
            .environment(TMXDeploymentEnvironment.Production)
}

3.3 Configuration Options

You can customize the Authentication SDK:

private val brandingColor: Int by lazy { BuildConfig.BRANDING_COLOR.toColorInt() }

TMAuthentication.Builder(
            // Your consumer key
            apiKey = BuildConfig.CONSUMER_KEY,
            // Team name to be displayed
            clientName = BuildConfig.TEAM_NAME
)
.region(TMXDeploymentRegion.US)
.environment(TMXDeploymentEnvironment.Production)
.modernAccountsQuickLogin(true)      // Enable quick login (default: true)
.modernAccountsAutoQuickLogin(true)  // Skip intro screen (default: true)
.forceNewSession(false)              // Set true for multi-team apps
.colors(createTMAuthenticationColors(brandingColor)) //Team colors for themeing

    private fun createTMAuthenticationColors(color: Int): TMAuthentication.ColorTheme =
        TMAuthentication.ColorTheme(
            //The Color class is part of the Compose library
            lightColors = lightColorScheme(
                primary = Color(color),
                secondary = Color(color),
                onPrimary = Color.White // Color used for text and icons displayed on top of the primary color.
            ), darkColors = darkColorScheme(
                primary = Color(color),
                secondary = Color(color),
                onPrimary = Color.White // Color used for text and icons displayed on top of the primary color.
            )
        )

Step 4: Configure Tickets SDK

Once Authentication is configured, set up the Tickets SDK with your branding:

4.1 Build Tickets Client


private suspend fun setupTicketsSDKClient(authentication: TMAuthentication) {
        //After called the build function of TMAuthentication.Builder object, we validate if configuration is different
        //from null, to verify if it was retrieved satisfactory a configuration file from the given params.
        authentication.configuration.let {
            val tokenMap = validateAuthToken(authentication)

            TicketsSDKClient.Builder(
                colors = createTicketsColors(brandingColor)
            )
                //Authentication object
                .authenticationSDKClient(authentication)
                //Function that generates a TicketsSDKClient object
                .build(this@MainActivity).apply {
                    //After creating the TicketsSDKClient object, add it into the TicketsSDKSingleton
                    TicketsSDKSingleton.setTicketsSdkClient(this)

                    //Validate if there is an active token.
                    if (tokenMap.isNotEmpty()) {
                        //If there is an active token, it launches the event fragment
                        launchTicketsView()
                    } else {
                        //If there is no active token, it launches a login intent. Launch an ActivityForResult, if result
                        //is RESULT_OK, there is an active token to be retrieved.
                        TicketsSDKSingleton
                            .getLoginIntent(this@MainActivity)
                            ?.let { resultLauncher.launch(it) }
                    }
                }
            /**
             * For testing purposes, you can use this to set to preprod etc.
             */
            TicketsSDKSingleton.setEnvironment(
                this,
                TicketsSDKSingleton.SDKEnvironment.Production,
                TicketsSDKSingleton.HostEnvironment.US
            )
        }
        if (authentication.configuration == null) {
            //custom logic for failure
        }
    }


    private suspend fun validateAuthToken(authentication: TMAuthentication): Map<AuthSource, String> {
        val tokenMap = mutableMapOf<AuthSource, String>()
        AuthSource.entries.forEach {
            //Validate if there is an active token for the AuthSource, if not it returns null.
            authentication.getToken(it)?.let { token ->
                tokenMap[it] = token
            }
        }
        return tokenMap
    }

    private fun createTicketsColors(color: Int): TicketsColorScheme = TicketsColorScheme(
        primary = TicketsColor(color.toLong()),
        eventsTopBar = TicketsColor(color.toLong())
    )

    
    private val resultLauncher = registerForActivityResult(
        ActivityResultContracts.StartActivityForResult()
    ) { result ->
        when (result.resultCode) {
            RESULT_OK -> {
                launchTicketsView()
            }

            RESULT_CANCELED -> {
                //custom logic for cancelation
            }
        }
    }
    private fun launchTicketsView() {
        //Retrieve an EventFragment
        TicketsSDKSingleton.getEventsFragment(this@MainActivity)?.let {
            supportFragmentManager.beginTransaction().replace(R.id.your_layout, it).commit()
        }

    }

Step 5: Launch Login

Once configured, you can present the Tickets SDK UI. First, the user needs to log in.

Login and Display Events

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        setupAuthenticationSDK()
        lifecycleScope.launch {
            TicketsSDKSingleton.sessionExpiredDelegate.collect {
                TicketsSDKSingleton.logout {
                    onLogout()
                }
            }
        }
    }

    private fun onLogout() {
        launchLogin()
    }

    private fun launchLogin() {
        TicketsSDKSingleton.getLoginIntent(this)?.let { resultLauncher.launch(it) }
    }
}

Step 6: Verify Your Integration

Test Checklist

  1. Build the app: Ensure there are no compilation errors

  2. Run the app: Verify the SDK initializes without crashes

  3. Login: Tap your login button - you should see the Ticketmaster login screen

  4. View tickets: After logging in with a Ticketmaster account that has tickets, you should see events and tickets

Troubleshooting

"Failed to initialize SDK" error:

  • Verify your API key is correct

  • Check that you're using the right environment (Production vs Staging)

  • Verify JitPack repository is added correctly

Build errors / dependency resolution:

  • Ensure JitPack is in your repositories

  • Check internet connection

  • Try ./gradlew clean build --refresh-dependencies

  • Verify version numbers match the changelog

Crashes on launch:

  • Ensure TicketsSDKSingleton.init() is called in Application.onCreate()

  • Verify Application class is registered in AndroidManifest.xml

  • Check that Authentication SDK is built before Tickets SDK

Login screen not appearing:

  • Verify getLoginIntent() returns a non-null Intent

  • Check that SDK is fully initialized before calling login

  • Ensure activity is a FragmentActivity

No tickets showing after login:

  • Ensure the logged-in account has purchased tickets

  • Check the API key has access to the correct backend (Host/Archtics)

  • Look for error messages in Logcat


Complete Minimal Example

Here's a complete minimal example that ties everything together:

// MyApplication.kt
package com.example.mytickets

import android.app.Application
import com.ticketmaster.tickets.ticketssdk.TicketsSDKSingleton

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        TicketsSDKSingleton.init(this)
    }
}
import android.os.Bundle
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.graphics.toColorInt
import androidx.lifecycle.lifecycleScope
import com.example.ticketsminimalbuild.ui.theme.TicketsMinimalBuildTheme
import com.ticketmaster.authenticationsdk.AuthSource
import com.ticketmaster.authenticationsdk.TMAuthentication
import com.ticketmaster.authenticationsdk.TMXDeploymentEnvironment
import com.ticketmaster.authenticationsdk.TMXDeploymentRegion
import com.ticketmaster.tickets.ticketssdk.TicketsColor
import com.ticketmaster.tickets.ticketssdk.TicketsColorScheme
import com.ticketmaster.tickets.ticketssdk.TicketsSDKClient
import com.ticketmaster.tickets.ticketssdk.TicketsSDKSingleton
import kotlinx.coroutines.launch
import kotlin.collections.isNotEmpty

class MainActivity : AppCompatActivity() {
    private val brandingColor: Int by lazy { BuildConfig.BRANDING_COLOR.toColorInt() }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        setupAuthenticationSDK()
        lifecycleScope.launch {
            TicketsSDKSingleton.sessionExpiredDelegate.collect {
                TicketsSDKSingleton.logout {
                    onLogout()
                }
            }
        }
    }
    private fun onLogout() {
        launchLogin()
    }

    private fun launchLogin() {
        TicketsSDKSingleton.getLoginIntent(this)?.let { resultLauncher.launch(it) }
    }
    private fun setupAuthenticationSDK() {
        lifecycleScope.launch {
            createTMAuthenticationBuilder().build(this@MainActivity)
                .fold(
                    onSuccess = { authentication ->
                        //after succesfully setting up Authentication, launch Tickets SDK
                        setupTicketsSDKClient(authentication)
                    },
                    onFailure = {
                        //Custom logic for failure
                    }
                )
        }
    }

    private fun createTMAuthenticationBuilder(): TMAuthentication.Builder =
        TMAuthentication.Builder(
            // Your consumer key
            apiKey = BuildConfig.CONSUMER_KEY,
            // Team name to be displayed
            clientName = BuildConfig.TEAM_NAME
        )
            .region(TMXDeploymentRegion.US) // Region that the SDK will use. Default is US
            .environment(TMXDeploymentEnvironment.Production)


    private suspend fun setupTicketsSDKClient(authentication: TMAuthentication) {
        //After called the build function of TMAuthentication.Builder object, we validate if configuration is different
        //from null, to verify if it was retrieved satisfactory a configuration file from the given params.
        authentication.configuration.let {
            val tokenMap = validateAuthToken(authentication)

            TicketsSDKClient.Builder(
                colors = createTicketsColors(brandingColor)
            )
                //Authentication object
                .authenticationSDKClient(authentication)
                //Function that generates a TicketsSDKClient object
                .build(this@MainActivity).apply {
                    //After creating the TicketsSDKClient object, add it into the TicketsSDKSingleton
                    TicketsSDKSingleton.setTicketsSdkClient(this)

                    //Validate if there is an active token.
                    if (tokenMap.isNotEmpty()) {
                        //If there is an active token, it launches the event fragment
                        launchTicketsView()
                    } else {
                        //If there is no active token, it launches a login intent. Launch an ActivityForResult, if result
                        //is RESULT_OK, there is an active token to be retrieved.
                        TicketsSDKSingleton
                            .getLoginIntent(this@MainActivity)
                            ?.let { resultLauncher.launch(it) }
                    }
                }
            /**
             * For testing purposes, you can use this to set to preprod etc.
             */
            TicketsSDKSingleton.setEnvironment(
                this,
                TicketsSDKSingleton.SDKEnvironment.Production,
                TicketsSDKSingleton.HostEnvironment.US
            )
        }
        if (authentication.configuration == null) {
            //custom logic for failure
        }
    }


    private suspend fun validateAuthToken(authentication: TMAuthentication): Map<AuthSource, String> {
        val tokenMap = mutableMapOf<AuthSource, String>()
        AuthSource.entries.forEach {
            //Validate if there is an active token for the AuthSource, if not it returns null.
            authentication.getToken(it)?.let { token ->
                tokenMap[it] = token
            }
        }
        return tokenMap
    }

    private fun createTicketsColors(color: Int): TicketsColorScheme = TicketsColorScheme(
        primary = TicketsColor(color.toLong()),
        eventsTopBar = TicketsColor(color.toLong())
    )


    private val resultLauncher = registerForActivityResult(
        ActivityResultContracts.StartActivityForResult()
    ) { result ->
        when (result.resultCode) {
            RESULT_OK -> {
                launchTicketsView()
            }

            RESULT_CANCELED -> {
                //custom logic for cancelation
            }
        }
    }
    private fun launchTicketsView() {
        TicketsSDKSingleton.getEventsFragment(this@MainActivity)?.let { fragment ->
            supportFragmentManager.beginTransaction()
                .replace(R.id.your_layout, fragment)
                .commit()
        }
    }
}

What's Next?

Now that you have the basic integration working, explore these topics:

Essential Next Steps

  • Sample App - Explore a complete example implementation

  • Configuration - Explore all branding and customization options

Advanced Features

Developer Resources


Need Help?


Frequently Asked Questions

Q: Do I need both Authentication and Tickets SDKs?
A: Yes, Tickets SDK depends on Authentication SDK for user login and API access. The tickets dependency includes Authentication SDK, but you must configure both.

Q: Can I customize the look and feel?
A: Yes! Use lightTicketsColorScheme() or darkTicketsColorScheme() to customize colors. See the Android Color Mapping guide for details.

Q: How do I test without real tickets?
A: Use the Staging environment (TMXDeploymentEnvironment.Staging) with test accounts provided by your Ticketmaster representative.

Q: What's the difference between Host and Archtics?
A: These are different ticketing backends. Host is Ticketmaster's primary ticketing system for North America. Archtics is used in other markets and by some specific clients. The SDK supports both automatically based on your API key.

Q: Can I use this with Jetpack Compose?
A: Yes! The SDK uses Compose internally and works seamlessly in Compose apps. You can display the events fragment in a Compose layout using AndroidView or AndroidViewBinding.

Q: How often does the SDK update?
A: We release updates regularly. Subscribe to our Android Change Log to stay informed.

Q: Why do I need JitPack?
A: The SDK is distributed via JitPack, which provides reliable Maven artifact hosting for maven projects.


Summary

You've successfully integrated the Tickets SDK! Here's what you accomplished:

  • Installed the SDK via Gradle with JitPack

  • Initialized TicketsSDKSingleton in your Application class

  • Configured Authentication SDK with your API key

  • Configured Tickets SDK with your branding colors

  • Displayed the tickets view in your app

  • Verified your integration works

Your users can now view, manage, and use their Ticketmaster tickets directly in your app!

Next: Explore Deep Linking to navigate directly to specific events, or check out the Sample App for more advanced integration examples.


Was this article helpful?