⚙️ Configure Fragment and View Monitoring for an Android Application
📖 Overview
The GermainUX Mobile App library can automatically monitor navigation between supported Android activities and the loading of supported fragments.
This provides visibility into:
|
Telemetry |
|---|
|
Screens and fragments used |
|
Navigation paths |
|
View and fragment load duration |
|
Time spent in application areas |
|
Errors associated with a screen |
|
Business-process steps |
|
Performance by application version, Android version, or device |
The available telemetry depends on the Android UI framework, lifecycle implementation, and installed GermainUX library version.
🔁 Activity and View Navigation
View-navigation monitoring is enabled automatically for supported activities that participate in the standard Android activity lifecycle, including supported activities based on AppCompatActivity.
GermainUX can use this lifecycle information to measure navigation between application views.
Common analysis includes:
|
Metric |
|---|
|
Number of visits |
|
Navigation duration |
|
Previous and next view |
|
Session context |
|
Application version |
|
Android version |
|
Device model |
|
Related transactions |
|
Related errors and exceptions |
No additional application code is normally required for supported activity navigation.
🔎 Fragment Monitoring
Fragment monitoring is enabled by default for supported AndroidX fragment implementations.
GermainUX can capture configured fragment lifecycle and load-duration information for supported:
|
Type |
|---|
|
|
|
|
|
|
Fragment visibility can be more complex than activity visibility. Multiple fragments may exist simultaneously, and a fragment can remain created while no longer being the primary content shown to the user.
Interpret fragment telemetry according to the application’s navigation and lifecycle design.
⛔ Disable Fragment Monitoring
Disable automatic fragment monitoring when:
|
Condition |
|---|
|
The application does not use fragments. |
|
Fragment telemetry is unnecessary. |
|
A custom navigation model produces misleading measurements. |
|
Monitoring creates excessive low-value data. |
|
The application uses another UI framework that requires custom instrumentation. |
Set the configuration before initializing GermainUX.
☕ Java
GermainAPMConfiguration config =
new GermainAPMConfiguration(
"https://YOUR_GERMAINUX_HOST/ingestion/fact"
);
config.setFragmentsMonitoring(false);
GermainAPM.init(this, config);
⚡ Kotlin
val config = GermainAPMConfiguration(
"https://YOUR_GERMAINUX_HOST/ingestion/fact"
)
config.setFragmentsMonitoring(false)
GermainAPM.init(this, config)
Disabling fragment monitoring does not disable the other configured Android monitoring capabilities.
🔧 Custom Views and Navigation Frameworks
Automatic monitoring depends on standard Android lifecycle callbacks.
Additional instrumentation may be required for:
|
Scenario |
|---|
|
Custom view frameworks |
|
Single-activity applications with non-fragment navigation |
|
Views that change without an activity or fragment transition |
|
Custom rendering engines |
|
Jetpack Compose destinations |
|
Business steps that do not correspond directly to a screen |
Use GermainUX custom transactions or events to represent navigation and load performance not captured automatically.
For example, a transaction can measure the time required to load a Compose destination or render a custom dashboard. A custom event can record that the user entered a specific workflow step.
🏷️ Naming Guidelines
Use stable, meaningful screen and fragment names.
Good names include:
|
Name |
|---|
|
|
|
|
|
|
|
|
|
|
|
|
Avoid including:
|
Do not include |
|---|
|
User names |
|
Email addresses |
|
Record identifiers |
|
Account numbers |
|
Search terms |
|
Timestamps |
|
Other dynamic or sensitive values |
Stable names allow GermainUX to aggregate performance and usage across sessions.
💼 Business-Process Monitoring
Activities and fragments can represent steps within an application business process.
For example:
|
Business process |
Views or fragments |
|---|---|
|
Customer onboarding |
Welcome, Identity, Address, Review, Confirmation |
|
Order creation |
Product Search, Product Details, Cart, Checkout |
|
Field service |
Work List, Work Order, Evidence, Completion |
|
Account support |
Customer Search, Account Details, Case Creation |
GermainUX can combine navigation data with transactions, events, errors, and sessions to analyze:
|
Analysis |
|---|
|
Process completion |
|
Step duration |
|
Repeated navigation |
|
Unexpected paths |
|
Abandonment |
|
Process overrun |
|
Lost productivity |
A screen visit alone does not always prove that a business step completed. Use a transaction or business event when confirmation of the outcome is required.
📊 Analyze Views and Fragments
Use GermainUX dashboards to analyze:
|
Analysis |
|---|
|
View and fragment usage |
|
Load duration |
|
Navigation frequency |
|
Entry and exit points |
|
Navigation paths |
|
Errors by view |
|
Transactions by view |
|
Application-version differences |
|
Device and Android-version differences |
|
User-session context |
|
Business-process progression |
Use percentiles and affected-user counts alongside average load duration.
🚨 Alerts
Configure alerts for important conditions such as:
|
Condition |
|---|
|
Critical view or fragment loading slowly |
|
Increased navigation failures |
|
New errors associated with a screen |
|
Performance regression after a release |
|
Critical screen no longer reached |
|
Increased abandonment at a business-process step |
Use minimum-volume and persistence conditions to avoid alerts caused by isolated sessions.
🔁 Android Lifecycle Considerations
Android can recreate activities and fragments because of:
|
Cause |
|---|
|
Configuration changes |
|
Process recreation |
|
Navigation behavior |
|
Memory pressure |
|
Device rotation |
|
Application restoration |
These lifecycle events can create additional loads that do not represent deliberate user navigation.
When analyzing unusual counts or durations, compare the data with:
|
Compare with |
|---|
|
Configuration changes |
|
Device orientation |
|
Application state |
|
Process restarts |
|
Android version |
|
Application navigation design |
🔒 Privacy
Activity and fragment class names are generally technical, but custom names or attributes can expose sensitive business context.
Before production deployment:
|
Action |
|---|
|
Review all screen and fragment names. |
|
Remove personal and record-specific values. |
|
Avoid capturing user-entered content. |
|
Apply anonymization or exclusion rules. |
|
Restrict access to session-level navigation data. |
|
Define an appropriate retention period. |
✅ Validation
After enabling monitoring:
-
Start the application.
-
Navigate through supported activities.
-
Open and replace fragments.
-
Return to previous screens.
-
Rotate the device where applicable.
-
Place the application in the background and return.
-
Verify view and fragment telemetry in GermainUX.
-
Confirm that names and durations are meaningful.
-
Test screens implemented with custom UI frameworks.
-
Add custom transactions or events where automatic monitoring is insufficient.
-
Confirm that no sensitive values are collected.
🔧 Troubleshooting
🔍 Activity navigation is missing
Verify that:
|
Check |
|---|
|
GermainUX initializes before navigation occurs. |
|
The activity uses a supported Android lifecycle. |
|
The application is included in the GermainUX monitoring scope. |
|
Telemetry reaches the ingestion endpoint. |
|
The release build contains the GermainUX library. |
❓ Fragment telemetry is missing
Confirm that:
|
Check |
|---|
|
Fragment monitoring is enabled. |
|
The application uses a supported fragment implementation. |
|
The fragment participates in normal lifecycle callbacks. |
|
The installed GermainUX library supports the AndroidX version in use. |
📈 View counts are higher than expected
Check for:
|
Possible cause |
|---|
|
Configuration changes |
|
Activity or fragment recreation |
|
Process restoration |
|
Nested fragments |
|
Background and foreground transitions |
|
Custom navigation behavior |
🤝 A Compose or custom view is not detected
Automatic activity and fragment monitoring may not represent that UI transition. Add a custom transaction or event for the destination or business step.
ℹ️ Get More Information
GermainUX can help determine which monitoring, analytics and automation capabilities are appropriate for your Android App environment.
Component: Engine, Mobile App
Feature Availability: 2022.1 or later