Chapter 6. Instrumentation of a Mobile App

To collect the metrics that were discussed in previous chapters, it is necessary to instrument your mobile apps before they are published. The purpose of this chapter is to give some details about the steps that are necessary to instrument your own mobile app on the technical side, and to distinguish between automated and manual instrumentation. Global marketplaces deliver native mobile apps to customers’ mobile devices, and the client-side operating systems execute them in a sandbox to prevent any potential harm to the customers’ smartphones. While server-side program instrumentation is often achieved by using profiling interfaces of standard virtual machines (VMs) and by hooking into the underlying operating systems, the monitoring of native mobile apps has to work in a different way to collect the demanded metrics without violating the client-side sandbox. Without the possibility of applying a profiling agent on millions of client smartphones and tablets, app publishers package and ship their native mobile apps together with the monitoring agent, as shown in Figure 6-1.

In order to monitor the usage of native mobile apps directly on customers’ smartphones and tablets, an app publisher has to select a monitoring agent, instrument the app, and package it along with the agent library. The publisher has to sign the entire app package that also contains the monitoring agent in order to upload it to one of the global marketplaces. Shipping ...

Get Mobile App Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.