On this page:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
98 rates

AppDynamics supports monitoring for hybrid applications based on the iOS/Android native SDK or any Cordova-based framework.

What Are Hybrid Applications?

Hybrid applications are web applications running inside an Android or iOS native shell. The web application can be in the form of an Android WebView, an iOS WKWebViews, or a Cordova web application that consists of HTML, CSS, JavaScript, and other resources just like a conventional web application. 

Hybrid Use Cases

Mobile RUM supports the following two use cases.

  • Native Mobile applications that run web applications or web views. Examples of this are Android WebViews and iOS WKWebView.
  • Applications written in Cordova-based frameworks, such as Ionic, that provide a native shell for running a web application and an interface for native mobile APIs.

Instrumentation Steps

To monitor your hybrid applications, you will need to set up and access Mobile RUM and follow the steps below based on your hybrid use case:

How it Works

For native Android/iOS applications, the Android Agent or iOS Agent will inject the JavaScript Agent into an Android WebView or iOS WKWebView. For Cordova-based applications, the AppDynamics plugin will inject the JavaScript Agent into the web application. 

The diagrams below provide an overview of how Mobile RUM is used to monitor mobile native applications and Cordova-based applications.

Mobile Native Application Architecture

 

You instrument your mobile application with either the Android/iOS Agent.

When your mobile application instantiates a WebView or WKWebView instance, the Mobile Agent injects the JavaScript Agent into it.

The JavaScript Agent monitors the performance and WebView usage.

The JavaScript Agent reports the application activity by sending beacons to the Mobile Agent.

The Mobile Agent repackages the browser beacons into mobile beacons and sends the beacons to the EUM Server.

Cordova-Based Application Architecture

 

The AppDynamics Cordova plugin injects the JavaScript Agent into the Cordova WebView.

 The Cordova-based application uses the plugin's JavaScript binding to configure the Mobile Agent.

The JavaScript Agent injected into the WebView monitors the application activity and performance.

 The JavaScript Agent sends browser beacons to the Mobile Agent.

 The Mobile Agent parses and converts the browser beacons into mobile beacons.

The Mobile Agent sends the mobile beacons to the EUM Server.

Mobile Agent and JavaScript Agent Compatibility

When hybrid app support is enabled, the Mobile Agents use the JavaScript Agent to monitor mobile web pages. If you are already monitoring the same mobile web pages with a browser application, the JavaScript Agent version used to instrument the browser application may be different than the JavaScript Agent version used by the Mobile Agent. This could cause compatibility issues that affect the monitoring results for both the mobile application and the browser application.

To avoid potential compatibility issues, ensure that the JavaScript Agent version instrumenting your browser application conform with the Mobile Agent versions listed below.

JavaScript Agent Version(s) of the Browser ApplicationMobile Agent Version(s)
4.5.4+ 4.5.5+

If you are using incompatible versions of the JavaScript Agents, do one of the following to correct the problem:

  • Upgrade the JavaScript Agent that you are using to instrument the browser application.
  • In the mobile instrumentation, disable the JavaScript Agent (iOS/Android), so that the mobile web pages are only instrumented by the browser application instrumented with the older version of the JavaScript Agent.

Hybrid Support Limitations

  • For mobile native applications, the JavaScript Agent is injected into the top-level WebView or WKWebView instance, not in embedded web pages (iFrames). You have to manually instrument the iFrames with the JavaScript Agent.
  • For Cordova-based applications, you have to manually report events using the plugin's JavaScript API.
  • Network calls made in the context of the WebView for Cordova-based applications show up as Ajax calls from the JavaScript Agent. 
  • No labels