View detection (public preview)
Instana provides a user journey analysis process for mobile application developers to understand how the user interacts with the app. This feature helps to automatically detect the lifecycle of the fragments and activities of an Android app and view controllers of an iOS app.
- Supported technologies
- Enabling view detection in the Android agent
- Enabling view detection in the iOS agent
- Analyzing views in the Instana UI
Supported technologies
The Android and iOS native applications support Instana view detection in the following agent versions:
- Instana Android agent 6.0.15 or later (Based on Gradle 7.3.3)
- Instana iOS agent 1.7.0 or later
Enabling view detection in the Android agent
To enable view detection in the Instana Android agent, complete the following steps:
-
You must ensure that the Instana Android agent plug-in and SDK are integrated in your Android application. For more information, see Android agent instructions.
-
Set the
autoCaptureScreenNames
property totrue
when you call theInstana.setup()
method. See the following example:class ExampleApp : Application() { override fun onCreate() { super.onCreate() val instanaConfig = InstanaConfig( key = "xxxxxx", reportingURL = "https://instana.example.com/mobile", autoCaptureScreenNames = true ) Instana.setup(this, instanaConfig) } }
Enabling view detection in the iOS agent
To enable view detection in the Instana iOS agent, complete the following steps:
-
You must ensure that the Instana iOS agent is installed in your iOS application. For more information, see the iOS agent instructions.
-
Set the
autoCaptureScreenNames
property totrue
when you call theInstana.setup()
method. See the following example:import UIKit import InstanaAgent @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let options = InstanaSetupOptions(autoCaptureScreenNames: true) Instana.setup( key: "xxxxxx", reportingURL: URL(string: "https://instana.example.com/mobile")!, options: options ) return true } }
Analyzing views in the Instana UI
After you enable auto view detection for an application, you can analyze the view data.
To analyze views in the Instana UI, complete the following steps:
-
Click Analytics in the Instana UI.
-
In the Analytics page, click Mobile Apps > View Transitions.
-
Filter your application as follows:
To see the view details, expand the View section, and then you can see the properties to describe the view. See the following screenshot:
A view has the following information in an Android app:
- Activity Name: The screen name of an activity.
- Activity Class Name: The simple class name of an activity.
- Activity Local Path: The class name of an activity with local path.
- Activity Resume Time: The time that is required by an activity to start interacting with a user.
- Fragment Name: The screen name of a fragment.
- Fragment Class Name: The simple class name of a fragment.
- Fragment Local Path: The class name of a fragment with local path.
- Fragment Resume Time: The time that is required by a fragment to start interacting with a user.
- Active Fragment List: A list of active fragments in the current view.
A view has the following information in an iOS app:
- Accessibility Label: A succinct label in a localized string that identifies the accessibility element.
- Navigation Item Title: The title of the navigation item that is displayed in the navigation bar.
- Class Name: The name of the view controller class.