Skip to content

Instantly share code, notes, and snippets.

@dturner
Created March 24, 2022 16:02
Show Gist options
  • Save dturner/20486cb6d745c68599586c40316c8345 to your computer and use it in GitHub Desktop.
Save dturner/20486cb6d745c68599586c40316c8345 to your computer and use it in GitHub Desktop.
Reporting performance class to Firebase analytics
class MyApplication : Application() {
private lateinit var devicePerf: DevicePerformance
private lateinit var firebaseAnalytics: FirebaseAnalytics
override fun onCreate() {
devicePerf = DevicePerformance.create(this)
firebaseAnalytics = Firebase.analytics
firebaseAnalytics.setUserProperty(
"androidx.core.performance.DevicePerformance.mediaPerformanceClass",
devicePerf.mediaPerformanceClass)
}
fun getVideoEncodeHeight() : Long = remoteConfig.getLong("encode_height")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment