'Can matomo customize and track screen views like Firebase analytics?

I am trying to migrate my application from Firebase to Matomo. One feature I would like to have is to keep track of average time user spends on a certain screen. While firebase generates it automatically for activities I can customise it with

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SCREEN_NAME, fragment.getClass().getSimpleName());
bundle.putString(FirebaseAnalytics.Param.SCREEN_CLASS, fragment.getClass().getSimpleName());
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW, bundle);

But Matomo has very limited documentation especially on tracking user engagement in Firebase fashion. Is this even possible for fragments?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source