Performance class

Stay organized with collections Save and categorize content based on your preferences.

Performance class is a standard first introduced in Android 12. A performance class defines a set of device capabilities that goes beyond Android's baseline requirements.

Each version of Android has its own corresponding performance class, which is defined in that version's Android Compatibility Definition Document (CDD). The Android Compatibility Test Suite (CTS) verifies the CDD requirements.

Each Android device declares the performance class that it supports. Developers can discover the device's performance class at runtime and provide upgraded experiences that take full advantage of the device’s capabilities.

To discover a device's performance class level, use the Jetpack Core Performance library. This library currently reports the device's media performance class. Start by creating an instance of DevicePerformance in your Application's onCreate() lifecycle event:

Kotlin

var devicePerformance = DevicePerformance.create(applicationContext)

Java

DevicePerformance devicePerformance = DevicePerformance.create(getApplicationContext());

You can then retrieve the mediaPerformanceClass property to tailor your app's experience based on the device's capabilities:

Kotlin

when {
  devicePerformance.mediaPerformanceClass >= Build.VERSION_CODES.S -> {
    // Performance class level 12 and above
    // Provide the most premium experience for highest performing devices
  }
  devicePerformance.mediaPerformanceClass == Build.VERSION_CODES.R -> {
    // Performance class level 11
    // Provide a high quality experience
  }
  else -> {
    // Performance class level undefined
    // Remove extras to keep experience functional
  }
}

Java

if (devicePerformance.mediaPerformanceClass >= Build.VERSION_CODES.S) {
  // Performance class level 12 and above
  // Provide the most premium experience for highest performing devices
} else if (devicePerformance.mediaPerformanceClass == Build.VERSION_CODES.R) {
  // Performance class level 11
  // Provide a high quality experience
} else {
  // Performance class level undefined
  // Remove extras to keep experience functional
}

Performance classes are forward-compatible. A device can upgrade to a newer platform version without updating its performance class. For example, a device that initially supports performance class 12 can upgrade to Android 13 and continue to report it supports class 12 if it does not meet the class 13 requirements. This means that a performance class provides a way to group devices together without relying on a particular Android version.

Performance class 12

In Android 12, the performance class focuses on media use cases. The specific performance class requirements are published in the Android CDD. The CDD specifies requirements in the following areas:

Media

  • Concurrent codec sessions
  • Startup codec latency
  • Frame drops
  • Encoding quality

Camera

  • Resolution
  • Startup & capture latencies
  • Video stabilization support
  • HDR image capture

Generic

  • Memory
  • Read/write performance
  • Screen resolution
  • Screen density

Performance class 11

Performance class 11 includes a subset of the requirements for performance class 12, allowing developers to provide a tailored experience on older, but still highly capable devices. The specific performance class requirements are published in the Android CDD.