Manual Touch Event Instrumentation

Activity Gestures Event Hook

For applications touch events must be manually forwarded to the Discover SDK at the Activity level.

Each Activity must override the dispatchTouchEvent() method and delegate the touch events to the SDK before passing them to the default framework handler.
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
    Discover.dispatchTouchEvent(this, event);
    return super.dispatchTouchEvent(event);
}

Technical Details

  • Intercepts all touch input events at the Activity level
  • Enables capture of taps, gestures data
  • Ensures accurate user interaction tracking and replay fidelity
  • Do not implement dispatchTouchEvent() inside Fragments
  • One implementation per Activity is sufficient
  • Gesture capture for Fragments is automatically enabled when Activity-level dispatching is in place