Screen (Activity) Recording

Screen View Logging

In the Discover SDK, each Android Activity is treated as a logical screen.

Screen view and layout information should be recorded during the Activity lifecycle to enable accurate session replay, UI reconstruction, and analytics.

Screen logging is typically performed during the onCreate() phase of the Activity.

// Logs the logical screen name for analytics and replay
Discover.logScreenview(activity, "ScreenName", ScreenviewType.LOAD);

// Captures the UI layout hierarchy after screen creation
Discover.logScreenLayoutOnCreate(activity, "ScreenName");

Technical Details

  • logScreenview()
    • Records a logical screen transition
    • Associates a human-readable screen name with the Activity
    • ScreenviewType.LOAD indicates an initial screen load event
  • logScreenLayoutOnCreate()
    • Captures the full view hierarchy after layout inflation
    • Enables UI structure reconstruction during replay

Best Practice

Use consistent and meaningful screen names to ensure accurate analytics and session traceability across the application.