Skip to content

Android SDK

Welcome to the Usera Usability Android SDK! This SDK provides an easy-to-integrate solution for Android developers who want to collect and analyze usability data for their applications. By leveraging this SDK, you can gain valuable insights into how your users interact with your prototypes and identify areas for improvement to enhance the overall user experience.

Features

  • Simple integration into your Android application
  • Optional video recording of user sessions for deeper analysis
  • Customizable data collection settings to suit your needs
  • Secure data storage and transmission to Usera server
  • Access to Usera's web dashboard for detailed analysis and reporting

Requirements

  • Android API level 26 or higher
  • Usera account for data storage and analysis

Installation

To add the Usera Usability Android SDK to your project, follow these steps:

Add the following dependency to your app-level build.gradle file:

repositories {
   maven {
      url = uri("https://usera.co/maven/")
   }
}

Then add the following dependency to your app-level or library build.gradle file:

dependencies {
   implementation("co.usera:usability-core:0.0.2")
}

Then Sync your project with the Gradle files to download and install the SDK.

Usage

To start using the Usera Usability Android SDK, you will need to initialize it in your Application class:

class App : Application() {

  override fun onCreate() {
    super.onCreate()

    UseraUsability.init(
      application = this,
      apiKey = "YOUR_USERA_API_KEY",
      environment = Environment.PRODUCTION,
    )
  }
}

Replace YOUR_USERA_API_KEY with the API key obtained from your Usera account.

Once initialized, you can start and stop data collection in your activities or fragments as needed:

class PageActivity : AppCompatActivity() {

  private var activeStudy: ActiveStudy? = null

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_page)

    val triggers = listOf(
      "payment_screen", "user_is_logged_in"
    )

    val button = findViewById<View>(R.id.start_test_button)
    button.setOnClickListener {
      // Start the test
      UseraMainActivity.open(it.context, activeStudy!!)
    }

    // Optional: Pass some triggers
    val triggers = listOf(
      "payment_screen", "user_is_logged_in"
    )
    UseraUsability.prepareUsabilityTest(triggers) { study ->
      // Save the active study
      this.activeStudy = study

      // Show the button to start the test
      button.isVisible = true
    }
  }
 }