Screen Loading for Android

Capture how long it takes for a particular screen to load automatically in your Android apps.

Instabug automatically captures the time it takes for any given screen to load. This covers the time for any Activity between onCreate and onResume which includes the following lifecycle methods:

  • onCreate
  • onStart
  • onResume

End Screen Loading

You can also define custom points in each Activity to manually inform the SDK that screen loading has ended.

APM.endScreenLoading(Class<T> activityClass)
APM.endScreenLoading(YourActivity.class);

Jetpack Compose Screen Loading

If you’re using Jetpack Compose and want to measure the loading time of your Composables, you need to complete Instabug’s Jetpack Compose Integration. Once Integrated, Composable loading times will start appearing in you Screen Loading metric.

Composables as Spans

By default, Composables will appear as spans within their parent Activities.

  • You can track the loading time of each composable in the spans table of it’s parent screen.
  • You can see individual composable occurrences as spans inside the occurrence page of their parent scree, in the spans timeline.

Composables as Screens

🚧

Min SDK Version

Configuring Composables to appear as separate screens is supported starting Android SDK version 14.3.0

If you use composables as entire screens (not just components), you can configure Composables. to appear in the dashboard as their own screens instead of as spans within their parent activities. This is configured through the showAsSceen property of the IBGScreen wrapper of the Jetpack Compose manual instrumentation approach.

@Composable
fun HomeScreen() {
    IBGScreen(screenName = "Home Screen", showAsScreen = false) { 
        Box {
           // Your Compose UI code goes here
        }
    }
}

showAsScreen: This is an optional configuration that controls how your composable will appear inside Screen Loading in APM.

  • false: This composable loading time will be tracked as a span inside it’s parent activity or composable. This is the default behavior if the configuration is not used.
  • true: This composable will appear as it’s own screen and will have all the details associated with screen loading (e.g. Apdex, P50, P90 ,Spans, etc.)

🚧

This configuration is only supported through the manual instrumentation wrapper for now

If you are using the automatic instrumentation, adding the manual wrapper to your composables might cause duplicate data to be reported. We’re working to build support for the automatic instrumentation soon.

Screen Loading Apdex

Instabug calculates an Apdex score for your app traces as a way of measuring their performance. An Apdex score ranges between 0 and 1; the higher the value, the better:

  • Apdex score ≥ 0.94 equates to Excellent performance.
  • Apdex score ≥ 0.85 and < 0.94 equates to Good performance.
  • Apdex score ≥ 0.7 and < 0.85 equates to Fair performance.
  • Apdex score ≥ 0.5 and < 0.7 equates to Poor performance.
  • Apdex score < 0.5 is considered Unacceptable.

How Is the Screen Loading Apdex Calculated?

When an app trace occurrence is collected, it is flagged based on a pre-defined target (T). An app trace occurrence is considered:

  • Satisfying: if its duration ≤ T
  • Tolerable: if its duration > T and ≤ 4T
  • Frustrating: if its duration > 4T

Then based on the bucketing explained above, the Apdex score is calculated as follows:

  • Total occurrences = Satisfying occurrences + Tolerable occurrences + Frustrating occurrences
  • Apdex score = (Satisfying occurrences + 0.5 * Tolerable occurrences) / Total occurrences

How Can You Control a Specific Screen's Target?

By default, the target is set to 0.1 seconds, however, you can easily change this number from your dashboard by clicking on your current threshold in the Apdex section.

Disabling/Enabling Screen Loading Tracking

If APM is enabled, our SDK starts collecting data about your screen loading time by default. If needed, you can always toggle this on and off by updating the relevant flag after the SDK is initialized:

APM.setScreenLoadingEnabled(boolean enabled)
APM.setScreenLoadingEnabled(boolean enabled);