44
Mobile Application Monitoring - Free Edition Android ADK User Guide November 2013

Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Embed Size (px)

Citation preview

Page 1: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Mobile Application Monitoring - Free EditionAndroid ADK User Guide

November 2013

Page 2: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Please direct questions about dynaTrace or comments on this document to:

APM Customer SupportFrontLine Support Login Page:

http://go.compuware.com

Copyright © 2013 Compuware Corporation. All rights reserved. Unpublished rights reserved under the Copyright Laws of theUnited States.

U.S. GOVERNMENT RIGHTS-Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth inCompuware Corporation license agreement and as provided in DFARS 227.7202-1(a) and 227.7202-3(a) (1995), DFARS252.227-7013(c)(1)(ii) (OCT 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14 (ALT III), as applicable.Compuware Corporation.

This product contains confidential information and trade secrets of Compuware Corporation. Disclosure is prohibited withoutthe prior express written permission of Compuware Corporation. Use of this product is subject to the terms and conditions of theuser's License Agreement with Compuware Corporation.

Documentation may only be reproduced by Licensee for internal use. The content of this document may not be altered, modifiedor changed without the express written consent of Compuware Corporation. Compuware Corporation may change the contentspecified herein at any time, with or without notice. All current Compuware Corporation product documentation can be found athttp://go.compuware.com.

Compuware, Compuware APM, dynaTrace, and other names and logos identifying Compuware products are trademarks orregistered trademarks of Compuware Corporation.

Adobe® Reader® is a registered trademark of Adobe Systems Incorporated in the United States and/or other countries.

All other company and product names are trademarks or registered trademarks of their respective owners.

Local Build: November 5, 2013, 13:38

Page 3: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Contents

5Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5Documentation Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7Chapter 1 ∙ Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7Supported Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9Chapter 2 ∙ Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9Overview of the Instrumentation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9Required Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10Installing the CompuwareUEM Eclipse Plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11Adding the Android ADK to the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12Basic Instrumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15Chapter 3 ∙ Instrumentation Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15Methods for Instrumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15CompuwareUEM.setMonitorCookie() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15CompuwareUEM.startup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16CompuwareUEM.shutdown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16CompuwareUEM.enableCrashReporting() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17UemAction.enterAction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17UemAction.leaveAction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18UemAction.reportEvent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18UemAction.reportValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19UemAction.reportError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19CompuwareUEM.reportError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20UemAction.tagRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21CompuwareUEM.tagRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21CompuwareUEM.registerRequestTaggingInterceptor() . . . . . . . . . . . . . . . . . . . . . .22CompuwareUEM.getRequestTagHeader() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22CompuwareUEM.getRequestTag() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22CompuwareUEM.flushEvents() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3Mobile Application Monitoring - Free Edition Android ADK User Guide

Contents

Page 4: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

23CompuwareUEM.uemCaptureStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23CompuwareUEM.setGpsLocation() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23CompuwareUEM.registerWebView() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23Return Code Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24Instrumenting a Service Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25Lifecycle Instrumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27Chapter 4 ∙ Collected Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31Chapter 5 ∙ Viewing Application Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32Mobile Application Performance Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33Summary Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33Performance Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34Availability Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36Drilling Down to Crash Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38Analytics Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40Event Tracking Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41Profile Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

43Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Mobile Application Monitoring - Free Edition Android ADK User Guide4

Contents

Page 5: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

I N T R O D U C T I O N

This guide provides information and instructions for using the Mobile Application Monitoring- Free Edition Android ADK to instrument your Android applications to collect performancedata directly from your application running on mobile devices.

Documentation ConventionsThe following font conventions are used throughout documentation:

IndicatesThis font

Terms, commands, and references to names of screen controls and userinterface elements.

Bold

Emphasized text, inline citations, titles of external books or articles.Citation

Links to Internet resources and linked references to titles in Compuwaredocumentation.

DocumentationConventions [p. 5]

Cited contents of text files, inline examples of code, command line inputs orsystem outputs. Also file and path names.

Fixed width

User input in console commands.Fixed width bold

Place holders for values of strings, for example as in the command:Fixed width italic

cd directory_name

Menu items.Menu ➤ Item

Text screen shots.Screen

Blocks of code or fragments of text files.Code block

Getting HelpWhen you are logged in to the Mobile Application Performance page, use the links on theleft side to display support resources.

5Mobile Application Monitoring - Free Edition Android ADK User Guide

Page 6: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Getting StartedThe Getting Started page provides basic instructions for downloading and instrumentingthe ADK.

Support CenterThe Support Center page contains links to display the iOS and Android versions of theuser guide; go to the Compuware YouTube channel to view tutorial videos; access theCompuware APM Community forum for Mobile Application Monitoring - Free Edition;or send email to request additional information or help.If no data is displayed for an instrumented application, refer to the troubleshootingsuggestions displayed on this page.

Mobile App CommunityUse this link to go directly to the Mobile Application Monitoring - Free Edition forum inthe Compuware APM Community. The forum includes an Open Q&A section where youcan post questions or share information with other users.

To log in, go to http://labs.gomeznetworks.com. If you have forgotten your username or password,click the Forgot your username or password? link to retrieve the information.If you have questions not addressed by the available support resources, send email [email protected].

Mobile Application Monitoring - Free Edition Android ADK User Guide6

Introduction

Page 7: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

C H A P T E R 1

Overview

Mobile Application Monitoring - Free Edition is a SaaS solution that monitors mobileperformance from the real user perspective. It provides performance statistics, crash reporting,and business analytics for native mobile applications. You can track the numbers of users andapplication sessions across geographical locations, devices, and networks; review performanceby device; analyze the impact of device characteristics such as signal strength, battery charge,and memory; and investigate the causes of crashes and errors.You can upgrade seamlessly from the Free Edition to the Professional Edition. For a comparisonof the features in the Free Edition vs. the Professional Edition, log in to the Mobile ApplicationPerformance web site at http://labs.gomeznetworks.com, and select the Upgrade link.

Supported PlatformsThe Android ADK is currently supported for Android versions 2.2 and above.

Best Practices

Privacy Policies for Capturing Mobile End User Data

Mobile applications are governed under the respected terms and conditions of such applications,which may include providing end-users with explicit information about the data that is collectedand reported from the applications that are running on the end user's mobile device. You andyour organization are responsible for complying with all such terms and conditions, as well asany or all applicable laws concerning data collection and end-user privacy that may requirenotices, consent, or opt-in screens.The Android ADK capabilities include the collection of information such as connection type,available memory, application execution time, and battery strength. All data is collectedanonymously and is only used in aggregate form. Such data is only collected to improve thequality of the mobile application and Compuware shall only use aggregated data to determinethe effectiveness of the mobile application.

7Mobile Application Monitoring - Free Edition Android ADK User Guide

Page 8: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Verifying Your Server URL

Before instrumenting your application, obtain your account ID and server URL string from theportal. Your Server URL maps the data collected from your mobile application to your account.If an incorrect server URL is used, your data will not be available in the Mobile ApplicationPerformance page.

Naming the Application Events

Name your application events so they are easy to identify in the reporting portal.

• The application event name can be up to 240 characters.

• In the Mobile Application Performance page, special characters and blanks in yourapplication name and event names will be replaced by underscores.

Mobile Application Monitoring - Free Edition Android ADK User Guide8

Chapter 1 ∙ Overview

Page 9: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

C H A P T E R 2

Getting Started

This chapter is intended to help mobile application developers get up and running as quicklyas possible with the Android ADK.It is assumed that you already have experience developing, building, and deploying Androidapplications and are familiar with the Eclipse IDE with Android SDK Tools installed. EclipseIDE version 3.7.1 is referenced in this guide. For more information, visithttp://developer.android.com.

Overview of the Instrumentation ProcessInstrumenting your mobile application involves the following tasks:

1. Download the Android ADK.The ADK is available through the Getting Started page in the reporting portal. See youractivation email for details.

2. Install the CompuwareUEM Eclipse plug-in.3. Include the Android ADK library in your Eclipse build environment.4. Instrument and test the mobile application.

Required PermissionsTo collect performance data, you must include permissions in the AndroidManifest.xml file.

NOTEYou can assign these permissions when you add the ADK to the Eclipse project. For moreinformation, see Adding the Android ADK to the Project [p. 11].

To be able to use the Android ADK, the application needs the following permissions:

• <uses-permission android:name="android.permission.INTERNET"/>

This permission is used for communication with the Compuware APM servers.

• <uses-permission

android:name="android.permission.ACCESS_NETWORK_STATE"/>

9Mobile Application Monitoring - Free Edition Android ADK User Guide

Page 10: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

This permission is used prior to communications with the Compuware APM servers toensure that there is an available network.

• <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

This permission is used for reporting:

◦ WiFi connection types.

◦ WiFi signal strength.

◦ WiFi link speed.

The following permissions are optional, depending on the data you want to collect:

• <uses-permission android:name="android.permission.GET_TASKS"/>

This permission is used only for lifecycle instrumentation.

• <uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Add this permission if you want to report device signal strength. If the permission is notprovided, Signal Strength will be blank in the reporting portal.

• <uses-permission

android:name="android.permission.ACCESS_FINE_LOCATION"/>

Add this permission to collect the device's GPS location. For more information, seeCompuwareUEM.setGpsLocation() [p. 23].

For more information about the AndroidManifest.xml file and Android permissions, seehttp://developer.android.com/reference/android/Manifest.permission.html.

Installing the CompuwareUEM Eclipse Plug-inThe CompuwareUEM Eclipse plug-in provides a context menu to add the Android ADK toeligible Android projects within Eclipse.

1. In Eclipse, add the software repository forhttp://update.compuware.com/compuwareuem/sdk/repo.

2. In the Available Software window, select the Compuware Mobile App MonitoringAndroid ADK feature.

Mobile Application Monitoring - Free Edition Android ADK User Guide10

Chapter 2 ∙ Getting Started

Page 11: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

3. Click Next, accept the terms of the license agreement, and click Finish.4. Restart Eclipse.

After Eclipse is restarted, Toggle Compuware Mobile App Monitoring appears on the contextmenu when you right-click an asset in Package Explorer.

Adding the Android ADK to the Project

Before You Begin

Required Software• Eclipse IDE. The recommended version is Eclipse 3.7.1.

• Android SDK Tools. For more information, refer to http://developer.android.com.

• CompuwareUEM Eclipse plug-in. For more information, see Installing theCompuwareUEM Eclipse Plug-in [p. 10].

1. In Package Explorer, right-click the Android project and select Toggle Compuware MobileApp Monitoring from the menu.

2. Select Add Compuware Mobile App Monitoring, then click OK.The Android ADK libraries are added to the project.

3. When a list of Android Permissions appears, copy all of the items in the list.4. Paste the permissions you just copied into the AndroidManifest.xml file.

Paste the permission items into the file right after the <uses-sdk /> section, as shown inthe example below.

11Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 2 ∙ Getting Started

Page 12: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

5. Click OK to dismiss the dialog box.

Basic InstrumentationComplete the following steps to add monitoring capability to your mobile app.After you complete the basic instrumentation procedure, you can fine-tune the data collectionby adding events and by configuring your application to monitor lifecycle events. For moreinformation, see Instrumentation Details [p. 15].

1. Import the CompuwareUEM class where appropriate.import com.compuware.uem.android.CompuwareUEM

2. Add the following method call to the onCreate() method of your main activity:CompuwareUEM.startup(this,

"My_Android_App", "URL_provided_in_your_activation_email", false, null)

Where My_Android_App is the name of your application andURL_provided_in_your_activation_email is the full URL, which includes your accountID: for example, http://abcdef.m.axf8.net (abcdef represents your account ID). ThisURL is provided through the email you received when you registered, and in the supportpage when you are logged in to the Mobile Application Performance page.

3. Add performance monitoring.a. Add the following in the onCreate() method of your main activity.

UemAction testAction = CompuwareUEM.enterAction("My_Android_Test_Action")

Where testAction is a class member and My_Android_Test_Action is the nameof your action.

b. Add the following at a later place in your app:testAction.reportEvent("My_Android_Test_Action")

c. Add the following method in the onResume() method of your main activity.CompuwareUEM.leaveAction()

4. Enable crash reporting.CompuwareUEM.enableCrashReporting(true)

Mobile Application Monitoring - Free Edition Android ADK User Guide12

Chapter 2 ∙ Getting Started

Page 13: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

This method enables the Android ADK to report unhandled exceptions.

NOTECrash reporting must be enabled to provide accurate data for Availability metrics, becauseavailability is calculated based on the number of crashes. For more information, seeAvailability Tab [p. 34].

5. Compile and run the application.

13Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 2 ∙ Getting Started

Page 14: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Mobile Application Monitoring - Free Edition Android ADK User Guide14

Chapter 2 ∙ Getting Started

Page 15: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

C H A P T E R 3

Instrumentation Details

Methods for InstrumentationTwo classes are defined in CompuwareUEM.jar. The CompuwareUEM class is used to managethe ADK operations. The UEMAction class is used to create actions and report against them.This section describes the methods available in the Android ADK for instrumenting your mobileapplication to collect performance data.For more information, see Return Code Definitions [p. 23].Some methods include functionality that is only available in the Professional Edition, as notedbelow. When you include these methods in the instrumentation for the Free Edition, thefunctionality is automatically available upon upgrading to the Professional Edition.

CompuwareUEM.setMonitorCookie()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. Call the method to define a cookie string to be sent alongwith every HTTP GET/POST method call made by the ADK (when establishing contact withthe backend or sending data to it).The use of this method is not typical. If called, this method must be invoked before the startupis called to ensure prompt and successful contact with the backend. It can be invoked again tochange the cookie string thereafter.

Syntaxvoid CompuwareUEM.setMonitorCookie(String cookieString)

Parameter• cookieString – A cookie string such as "MIGRATION_FLAG=3" or "n1=v1; n2=v2".

CompuwareUEM.startup()Call this method to initialize the ADK for capturing and reporting data. It is recommended thatit be invoked as early as possible in your application startup sequence.A common place for the startup() call is the onCreate() function of the main activity.

15Mobile Application Monitoring - Free Edition Android ADK User Guide

Page 16: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Syntaxint CompuwareUEM.startup(final Context context, final String sApplId, final String

agentPath, boolean useAnyCert, KeyStore keyStore)

Parameters• context – The Android context.

• sApplId – An application identifier (for example, "HelloWorldApp").

• agentPath – The path to the placed UEM agent (for example,"abcdef.m.axf8.net").

• useAnyCert – Allow any certificate for HTTPS communication. This variable willonly be evaluated if you specified the HTTPS transport mechanism in agentPath.

• keyStore – The key store holding the certificate(s) for SSL communication. Thisparameter will only be used if the agentPath specifies HTTPS and useAnyCert isfalse. The value of keyStore can be null if not used.

Return Values• CPWR_UemOn

• CPWR_Error_InvalidParameter

CompuwareUEM.shutdown()Use this method when you want to stop collecting data. The method shuts down the ADKgracefully.The ADK also attempts to flush the data for up to 5 seconds. Any remaining data after thisperiod is flushed on the next application start.

NOTECall CompuwareUEM.flushEvents() if all data is to be flushed right away.

Syntaxvoid CompuwareUEM.shutdown();

CompuwareUEM.enableCrashReporting()This method enables the Compuware UEM crash handler to report crashes, i.e., uncaughtexceptions in your application threads. In the event of an uncaught exception, the UEM crashhandler will process the exception for reporting and pass on the exception to the default uncaughtexception handler.

NOTEA crash is only processed and reported if the ADK is initialized and active (return codeCPWR_UemOn), and the sendCrashData parameter is enabled. If the same exception reoccurswithin seven days, the crash data is not reported again; but a crash event is reported referencingthe previously reported crash data.Crash reporting must be enabled to collect accurate availability data.

Mobile Application Monitoring - Free Edition Android ADK User Guide16

Chapter 3 ∙ Instrumentation Details

Page 17: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Syntaxvoid CompuwareUEM.enableCrashReporting(boolean sendCrashData)

Parameter• sendCrashData – Assign a value of true to send crash data; or false if you do not

want crash data sent.

UemAction.enterAction()This method creates an action object for reporting the time elapsed between two user-definedtimes, a start interval and an end interval, in the application lifecycle.Other event types can be reported within the context of the action object, creating a series ofevents within an action scope. For example, you can use an enterAction and a leaveActionto determine how long it takes to pull content such as a large image or a large volume ofconfiguration data into your application from a remote server.An enterAction must have a corresponding leaveAction to complete the action.In the Professional Edition, the action results in a mobile action PurePath in Compuware APM.

SyntaxUemAction CompuwareUEM.enterAction(String actionName)

UemAction UemAction.enterAction(String actionName)

Using the syntax shown below, enterAction() starts an action that is a child of thespecified parentAction.UemAction CompuwareUEM.enterAction(String actionName, UemAction parentAction)

UemAction UemAction.enterAction(String actionName, UemAction parentAction)

Parameters• actionName – The name by which you will identify the action event in the collected

data.

• parentAction – A parent UemAction object.

Return Value• UemAction object – This method always returns a valid action object.

NOTE

• An action cannot run longer than the length of a session.

• If multiple occurrences of enterAction() with the same name are encountered before thematching leaveAction(), the interval will be calculated from the last enterAction()to the leaveAction().

UemAction.leaveAction()This method ends the action that begins with the preceding enterAction.All reported events for this action and all values collected between the start and end of an actionare part of the action. Place a call to this function at the end of the code that you want to time.This reports the number of milliseconds between the enterAction and leaveAction calls.

17Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 3 ∙ Instrumentation Details

Page 18: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

NOTEWhen an outer/parent action is exited, all nested/child actions are automatically closed.

Syntaxint UemAction.leaveAction()

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_ActionEnded

• CPWR_Error_NotInitialized

UemAction.reportEvent()This method reports the time that the event occurred, relative to the session start time.It can be used to determine when a user passed through a particular view or activity in yourapplication. The reportEvent is a simple way to track user behavior in your application.Configure the reportEvent, specifying the name of the item you want to capture. A time stampis added to the event and this data is sent back to the backend database.

Syntaxint UemAction.reportEvent(String eventName)

Parameter• eventName – The name by which you will identify the named event in the collected

data.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_InvalidParameter

• CPWR_ActionEnded

• CPWR_Error_NotInitialized

UemAction.reportValue()This method reports a user-defined integer value at any user-defined time in the applicationlifecycle.For example, if your application receives a variable amount of data each time it makes a requestfor data, it may be useful to report the number of pieces of data received each time the requestis made. The value can be processed by a measure and thus be charted.

Syntaxint UemAction.reportValue(String valueName, int value)

int UemAction.reportValue(String valueName, double value)

int UemAction.reportValue(String valueName, String value)

Mobile Application Monitoring - Free Edition Android ADK User Guide18

Chapter 3 ∙ Instrumentation Details

Page 19: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Parameters• valueName – The name by which you will identify the custom value event in the

collected data. This field can contain up to 240 characters.

• value – The value itself, of the specified data type. Valid integer values for this eventare 0 through 2147483.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_InvalidRange

• CPWR_ActionEnded

• CPWR_Error_NotInitialized

• CPWR_Error_InvalidParameter

• CPWR_Error_NotSupportedInFreeMode – The syntax reportValue(String,double) is only supported in the Professional Edition.

UemAction.reportError()This event sends a key=value pair to the Compuware APM server. In the Professional Edition,it results in an error node of the calling mobile action PurePath.

Syntaxint UemAction.reportError(String errorName, int errorCode)

int UemAction.reportError(String errorName, Throwable throwable)

Parameters• errorName – The error name as a character string.

• errorCode or throwable – An integer that represents the error code. If throwable,only toString() is reported.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_InvalidParameter

• CPWR_ActionEnded

• CPWR_Error_NotInitialized

• CPWR_ReportErrorOff

• CPWR_Error_NotSupportedInFreeMode – The syntax reportError(String,Throwable) is only supported in the Professional Edition.

CompuwareUEM.reportError()This method of the CompuwareUEM class sends a key=value pair to the Compuware APMserver, outside of the context of any action.

19Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 3 ∙ Instrumentation Details

Page 20: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

It reports a user-defined integer value or an exception at any user-defined time in the applicationlifecycle. The report error event is different from the custom (integer) value event in that it isspecifically identified as an error type of event. The integer value would most likely contain anerror code.In the Professional Edition, it results in an error node not in context of any action.

Syntaxint CompuwareUEM.reportError(String errorName, int errorCode);

int CompuwareUEM.reportError(String errorName, Throwable throwable);

Parameters• errorName – The error name as a character string.

• errorCode or throwable – An integer that represents the error code. If throwable,only toString() is reported.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_InvalidParameter

• CPWR_Error_NotInitialized

• CPWR_ReportErrorOff

UemAction.tagRequest()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. The method sets a request tag (the Compuware APMrequest header) on a web request, which is evaluated by the Compuware APM server to correlatea web request to the calling action.

Syntaxint UemAction.tagRequest(HttpRequest request)

int UemAction.tagRequest(HttpURLConnection conn)

Parameters• request – The request object.

• conn – The request object.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_InvalidParameter

• CPWR_ActionEnded

• CPWR_Error_NotInitialized

Mobile Application Monitoring - Free Edition Android ADK User Guide20

Chapter 3 ∙ Instrumentation Details

Page 21: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

CompuwareUEM.tagRequest()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. The method sets a request tag (the Compuware APMrequest header) on a web request, which is evaluated by the Compuware APM server to correlatea web request to an action if possible. Since there is no explicit action, the web request iscorrelated to an action according to the following rule:

1. If there is an open action in the current thread at the time the request is tagged, the webrequest is assigned (by the ADK) to the open action.

2. If there is no open action in the current thread, the web request is assigned (by theCompuware APM server) to an action that calls its leaveAction() method in the samethread where the tagging is done. The tagging time must fall between the action enter andleave times.

3. If neither of the preceding cases applies, the web request is not assigned to any action.

Syntaxint CompuwareUEM.tagRequest(HttpRequest request)

int CompuwareUEM.tagRequest(HttpURLConnection conn)

Parameters• request – The request object.

• conn – The request object.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_NotInitialized

CompuwareUEM.registerRequestTaggingInterceptor()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. Call this function to register an interceptor that willautomatically set a request tag (the Compuware APM request header) on each web request,which is evaluated by the Compuware APM server to correlate a web request to an active actionif possible. The rule described for CompuwareUEM.tagRequest() is applied.

Syntaxint CompuwareUEM.registerRequestTaggingInterceptor(DefaultHttpClient client)

Parameter• client – The DefaultHttpClient object where the interceptor will be registered.

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_InvalidParameter

• CPWR_Error_NotInitialized

21Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 3 ∙ Instrumentation Details

Page 22: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

CompuwareUEM.getRequestTagHeader()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. This method returns the Compuware APM request tagheader name to be used in conjunction with the value returned by getRequestTag().

SyntaxString CompuwareUEM.getRequestTagHeader()

Return Value• "X-dynaTrace" – Request tag header key/name.

CompuwareUEM.getRequestTag()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. Used with getRequestTagHeader(), this method providesa way to tag a web request when you cannot use tagRequest().

SyntaxString CompuwareUEM.getRequestTag()

Return Value• Compuware APM tag string – Request tag header value, which is specific to a given

logic path. The ADK returns an empty string if the current state is not CPWR_UemOn.

ExamplebuttonSearch.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

....

UemAction uemAction;

try {

HttpTransportSE androidHttpTransport = new HttpTransportSE(url);

....

uemAction = CompuwareUEM.enterAction("ActionName");

List<HeaderProperty> list = new ArrayList<HeaderProperty>();

list.add(new HeaderProperty(CompuwareUEM.getRequestTagHeader(),

CompuwareUEM.getRequestTag()));

androidHttpTransport.call(action, envelope, list);

} finally {

uemAction.leave();

}

....

}

});

CompuwareUEM.flushEvents()Call this function to flush all collected events immediately. To reduce network chatter, thecollected events are usually sent in packages where the oldest event has an age of up to 2 minutesby default in the Professional Edition, the maximum age can be configured. Using this function,you can force sending of all collected events regardless of their age.

Syntaxvoid CompuwareUEM.flushEvents()

Mobile Application Monitoring - Free Edition Android ADK User Guide22

Chapter 3 ∙ Instrumentation Details

Page 23: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

CompuwareUEM.uemCaptureStatus()Use this method to get the current UEM data capturing state.

Syntaxint CompuwareUEM.uemCaptureStatus()

Return Values• CPWR_UemOn

• CPWR_UemOff

• CPWR_Error_NotInitialized

CompuwareUEM.setGpsLocation()This method saves the specified GPS location for reporting along with the captured data.

Syntaxint CompuwareUEM.setGpsLocation(Location location);

Parameter• location – The location object that contains the device's current GPS location.

Return Value• CPWR_UemOn – Successful.

CompuwareUEM.registerWebView()This method can be instrumented in the Free Edition, but data is only reported when you haveupgraded to the Professional Edition. Call this function to register a web view so that Javascripts (intended to be executed in the web view) can be instrumented with the Android ADK.Each web view must be registered separately.A call to this method results in enabling JavaScript execution in the registered web views.Blanket web request tagging using the JavaScript function startTaggingRequests also enablesthe CookieManager to accept cookies.

Syntaxboolean CompuwareUEM.registerWebView(WebView webView)

Parameter• webView – The web view to be registered.

Return Value• boolean – TRUE if successfully registered; Otherwise, FALSE (such as when running

with Android 2.3.x).

Return Code DefinitionsEntering an action always returns a valid action object, regardless of the state of the AndroidADK. When you act on an action object such as UemAction.reportEvent(), one of thefollowing return codes is returned. The reported event is not captured unless the CPWR_UemOncode is returned.

23Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 3 ∙ Instrumentation Details

Page 24: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

The action is only valid and processed if the leaveAction() method returns CPWR_UemOn.

DescriptionCode

Data capturing is on; a method call is successful.CompuwareUEM.CPWR_UemOn

Data capturing is off.CompuwareUEM.CPWR_UemOff

CompuwareUEM.startup(...) is not called orCompuwareUEM.shutdown() is already called.

CompuwareUEM.CPWR_Error_NotInitialized

UemAction.leaveAction() is already called.CompuwareUEM.CPWR_Error_ActionEnded

A bad parameter is passed to the method.CompuwareUEM.CPWR_Error_InvalidParameter

A bad integer value is passed to the method.CompuwareUEM.CPWR_Error_InvalidRange

The operation is only supported in the Premium Edition.CompuwareUEM.CPWR_Error_NotSupportedInFreeMode

Errors are not reported, because either error reporting isoff or only reports in WiFi while on a mobile connection.

CompuwareUEM.CPWR_ReportErrorOff

Instrumenting a Service ApplicationInstrumenting a service is similar to instrumenting an activity-based application. The basicinstrumentation procedures are identical and the available data collection methods remainunchanged. However, an instrumented service cannot collect automatic lifecycle events.

NOTE

To monitor an application that runs as an Android Service, make sure CompuwareUEM.startup()is called before attempting to capture any events. It is recommended to call it from theonCreate() method in the service, as in the following example:public class MyService extends Service {

@Override

public void onCreate() {

CompuwareUEM.startup(this, "MyServiceApp", serverURL, true, null);

....

// other initialization code, etc...

}

}

When this code has executed, you can use all of the basic methods for instrumentation availablein the ADK. For more information, see Methods for Instrumentation [p. 15].

Stopping the ADK

If the service has finished execution and you no longer want to collect data from any instrumentedclasses in your application, you can shut down the ADK by inserting the following lines in theonDestroy() method of the service:@Override

public void onDestroy() {

....

// other code to clean up and shut down your service

CompuwareUEM.shutdown();

}

Mobile Application Monitoring - Free Edition Android ADK User Guide24

Chapter 3 ∙ Instrumentation Details

Page 25: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

IMPORTANTIf your application is still running and you still want to collect data from instrumented classes,do not call shutdown when the service is destroyed. The reason for this is that only one instanceof the ADK can run at any time. Shutting it down when the service is destroyed will make itunavailable elsewhere in your application unless CompuwareUEM.startup() is called again.

Lifecycle InstrumentationUse this procedure to enable lifecycle data instrumentation.With lifecycle instrumentation, the ADK automatically collects the following data and rendersthem as actions:

• Application start event – Represents the time from Application.onCreate() toActivity.onPostResume() of the first activity displayed.

• Activity display – Represents the time from Activity.onCreate() toActivity.onPostResume().

• Activity redisplay – Represents the time from Activity.onStart() toActivity.onPostResume().

NOTEIt is possible for web requests or crash events to appear within the activity display or redisplayactions.Lifecycle data collection is enabled by default when you perform this procedure. In theProfessional Edition, it can be disabled.

Add lifecycle data instrumentation to your application by editing the AndroidManifest.xmlfile.

1. Add GET_TASKS permission.<uses-permission android:name="android.permission.GET_TASKS"/>

2. Do one of the following:• If the application element specifies an application class (that is not

android.app.Application), open that class and change the import statement from,for example, import android.app.Application to importcom.compuware.android.app.Application. Specifically, add the prefixcom.compuware. to the package name.

IMPORTANTYour application class constructor must call super() and the onCreate() methodmust call super.onCreate().

• If the application element does not specify an application class, add the following:android:name="com.compuware.android.app.Application"

25Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 3 ∙ Instrumentation Details

Page 26: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Alternatively, you could use the Application Manifest Application editor in Eclipseto add com.compuware.android.app.Application.

3. Update the application activities.For each activity in the application, change the import statement by prefixingcom.compuware. to the package name. For example, change importandroid.app.Activity to import com.compuware.android.app.Activity.Other supported activities include AliasActivity, ListActivity,ExpandableListActivity, and LauncherActivity.

NOTEFor com.google.android.maps.MapActivity, change the package name tocom.compuware.android.ext.maps.MapActivity.

Sherlock ActionBar activities are also supported. For example, changecom.actionbarsherlock.app.SherlockActivity tocom.compuware.android.ext.sherlock.SherlockActivity.

IMPORTANTThe root or main activity should extend a CompuwareUEM activity. The Application Start eventstarts when the application is created (Application.onCreate()) and ends when the firstactivity is displayed (Activity.onPostResume()). If the first activity does not extend aCompuwareUEM activity, the Application Start event time will be incorrectly recorded.The GET_TASKS permission is used to automatically detect application lifecycle transitions fromforeground to background. This method provides the most reliable detection of application statechanges if lifecycle monitoring is enabled. It does not collect, store, or transmit which applicationsare running on a user's device. The Android ADK can only reliably determine theforeground/background transition if all activities extend CompuwareUEM activities.

LoggingLogging is off by default for the Android ADK. If you need the ADK log, you can change thelogging settings at any time.Enable logging by adding this method before the startup call:SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);

Editor ed = sp.edit();

ed.putString("CPWR_DiagMode", "1");

ed.commit();

Mobile Application Monitoring - Free Edition Android ADK User Guide26

Chapter 3 ∙ Instrumentation Details

Page 27: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

C H A P T E R 4

Collected Data

This table describes the metrics and other data collected by the Mobile Application ADK.

DescriptionMetric

The name you chose for the action when instrumenting yourapplication.

Action name

The number of users affected by the crash type or error type.Affected users

The mobile application name.Application name

The version of the application installed on the mobile device.Application version

The percentage of time the application successfully started andran, measured by the following formula:availability % = (sessions – crashes) / sessions

Availability

The average response time (duration) of all application startsand instrumented actions during the selected time period.

Average response time

The battery strength as a percentage of the full charge, reportedas a decimal number 0.00 through 1.0, where 1.0 = 100%

Battery level

charged. If the application is running on a device simulator, thebattery strength will be zero.

The network through which the device is connected to thecellular network or the Internet.

Carrier network

The percentage of users connected through each detected carrier.Carrier usage

The message that describes the crash. The description isretrieved from the signal or exception name produced by theoperating system.

Crash description

The date and time when the crash occurred. In the User SessionLog in the Mobile Application Performance page, this metricis labeled Crash Occurred At.

Crash occurrence time

The number of crashes that occurred during the selected timeperiod.

Crashes

27Mobile Application Monitoring - Free Edition Android ADK User Guide

Page 28: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

DescriptionMetric

The data returned by the selected report value event.Data value

The model and version of the mobile device.Device

The lifecycle duration of an action, displayed as mm:ss:SSSS.Events that are not actions have no duration.

Duration

The description of the error as specified in the report error event.Error message

The error message number as specified in the report error event.Error number

The number of errors that occurred during the selected timeperiod.

Errors

The name of the lifecycle event, specified when the applicationwas instrumented.

Event [or Event name]

The date and time when an action began. For lifecycle eventsthat are not actions, the date and time the event occurred.

Event start time

The event type designation, and the data type (e.g. String) ifapplicable.

Event type

The number of lifecycle events that were completed during thesession in which the selected crash occurred.

Events in sequence

The longest response time within the selected time period.Maximum response time

Percentage of total available memory.Memory usage

The shortest response time within the selected time period.Minimum response time

The device platform: iOS or Android. If the application isrunning on a device simulator, the operating system is listed.

Mobile platform

The percentage of users connected via each detected protocol.Network protocol usage

The number of applications that were active when the crashoccurred.

Number of applications running

The number of times an incident (action, event, or crash type,depending on the reporting context) occurred.

Occurrences

The number of report events ( reportEvent()) that occurredduring the selected time period.

Report events

The number of report value events (reportValue()) thatoccurred during the selected time period.

Report values

A number assigned to an event in the Session Breakdown Logto identify the event and indicate the order in which events werecompleted preceding a crash.

Sequence number

The amount of time a session lasted.Session duration [or Session length]

Total number of sessions active during the selected time period.Sessions

Signal strength measured in dBm.Signal strength

Mobile Application Monitoring - Free Edition Android ADK User Guide28

Chapter 4 ∙ Collected Data

Page 29: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

DescriptionMetric

The first 10 lines of the selected session's stack trace.Stack trace

The date and time when the session began.Start time [or Session start time]

The total number of unique users during the selected timeperiod. A user that has more than one session is only countedonce.

Unique users

The total number of report events and report value eventsexecuted during the selected time period.

User events

The user ID assigned by the application to associate events withthat specific user.

User ID

The number of users that accessed the selected event.Users

The percentage users using devices with each detected platform.Users by platform

The percentage of users in each detected geographic region.Users by region

29Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 4 ∙ Collected Data

Page 30: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Mobile Application Monitoring - Free Edition Android ADK User Guide30

Chapter 4 ∙ Collected Data

Page 31: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

C H A P T E R 5

Viewing Application Data

View the performance data collected from your users' devices in the Mobile ApplicationPerformance page.

Before You Begin

It is assumed that you have already activated your new account. If you have not yet done so,refer to the Account Activation email you received after signing up for your account.

NOTEIf you have instrumented the application and tested it but no data appears in the MobileApplication Performance page, verify that you used the correct Server URL in the application,and m.axf8.net is specified in the Server URL. If the Server URL is not specified or is incorrect,your data will not appear in the Mobile Application Performance page.It may be that no data appears in the page because no data was generated during the selectedtime frame.For more information about issues that prevent data from being displayed, include CPWRLog.hin your application and turn on logging. You will be able to see if there are any error messagesbeing logged by the Mobile App ADK code.

1. Log in at http://labs.gomeznetworks.com.The Mobile Application Performance page appears.

2. Use the lists at the top of the window to select the data to display.

• Application – Select the instrumented application for which you want to view thedata.

• Mobile Platform – Select whether to view data from All Platforms (the default),Android devices, or iOS devices.

• Time Period – Select whether to view data from Last 7 days (the default), Yesterday,Today, or Last 24 hours.

31Mobile Application Monitoring - Free Edition Android ADK User Guide

Page 32: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

The charts display data per day if you select Last 7 days, or data per hour for the otherTime Period options.

3. Select a tab to view detailed data for the selected category.The Summary tab is selected by default. It displays charts for Performance, Availability,Analytics, and Event Tracking. For more detail about each data category, select the tabfor that category. For more information, see Mobile Application Performance Page [p. 32].

At the top of the page are links to support information and additional resources. For moreinformation, see Getting Help [p. 5].For information about the enhanced features that are available in the Professional Edition, clickthe Why Go Premium? link.

Mobile Application Performance PageThe Mobile Application Performance page displays the data collected from instrumentedmobile applications.

NOTEThe first time your instrumented application is started, there is a delay while the applicationinformation is propagated to the database. Therefore, the first few minutes of data collectedafter instrumentation will not be available. After this one-time delay, all collected data will bedisplayed in the Mobile Application Performance page.

Data Filters

Use the lists at the top of the page to filter the data:

• Application – Select the instrumented application for which you want to view the data.

• Mobile Platform – Select whether to view data from All Platforms (the default), Androiddevices, or iOS devices.

• Time Period – Select whether to view data from Last 7 days (the default), Yesterday,Today, or Last 24 hours.The charts display data per day if you select Last 7 days, or data per hour for the otherTime Period options.

Charts

Hover over a bar graph or a data point to display the measurement at the selected time. Hoverover the measurement displayed to the left of a chart to see a tooltip that explains themeasurement.Click a label in the chart legend to remove the data from the graph to focus on data of interest.For example, click Min under the Performance chart to remove the line for the minimumresponse time. Click the label again to restore the data to the graph.

Mobile Application Monitoring - Free Edition Android ADK User Guide32

Chapter 5 ∙ Viewing Application Data

Page 33: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Tables

You can select columns to display in the tables: Click the list icon at the right side of thetable header, then click a column name to hide or display it. Displayed columns have a circlenext to the name. You can sort a table column by clicking the column head. You may have toclick more than once to sort in the desired order.The columns included in the tables vary depending on the option selected for the MobilePlatform filter. See the table descriptions below for details.

Summary TabThe Summary tab is displayed by default. It provides an overview of performance, availability,analytics, and event tracking for the selected application.The charts on this tab are also displayed on the Performance, Availability, Analytics, andEvent Tracking tabs, with additional details for each data category. For details, see below.

Performance Tab

Chart

The Performance chart displays line graphs for maximum, average, and minimum responsetimes over time of the Action events and Application Start events. For more information, seeMethods for Instrumentation [p. 15].

NOTEThe line graph for the maximum values will peak at 2.5 times the highest average, even if theactual maximum value is greater than that. The tooltips for the data points will show the actualmaximum value.

The average performance displayed to the left of the chart is color coded to indicate performancequality:

• Green – Average response time 3 seconds or less

• Yellow – Average response time 3–5 seconds

• Red – Average response time longer than 5 seconds

Table

Below the chart, the Action Performance Details table lists information for each action.

33Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 5 ∙ Viewing Application Data

Page 34: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

When you select All Platforms in the Mobile Platforms list, the following columns aredisplayed:

• Action Name – The name you chose for the action when instrumenting your application.

• All Platforms – The average response time in seconds for all devices on all platforms.

• iOS – The average response time in seconds for iOS devices.

• Android – The average response time in seconds for Android devices.

• Occurrences – The number of times the action occurred.

When you select Android or iOS in the Mobile Platforms list, the following columns displaydata from devices running the selected platform:

• Action Name – The name you chose for the action when instrumenting your application.

• Average – The average response time in seconds.

• Maximum – The maximum response time in seconds.

• Minimum – The minimum response time in seconds.

• Occurrences – The number of times the action occurred.

The bars next to the values in each column provide a visual indication of the relative values,for example, which actions have the highest or lowest values.The following figure shows the table with All Platforms selected.

Availability TabNOTETo display accurate Availability data, you must have crash reporting enabled.

Chart

The Availability chart shows the average availability, the number of errors, and the number ofcrashes for the selected time period.Availability is calculated as a percentage of the total sessions, using the following formula:(sessions – crashes) / sessions

The availability percentage displayed to the left of the chart is color coded to indicate performancequality:

• Green – Availability 95% or better

• Yellow – Availability 90% to 95%

• Red – Availability less than 90%

Mobile Application Monitoring - Free Edition Android ADK User Guide34

Chapter 5 ∙ Viewing Application Data

Page 35: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

The chart contains:

• An Availability bar graph for each time interval when data was collected.

• An Errors line graph with data points for each time interval when errors occurred.

• Crashes data points for each time interval when crashes occurred.

Details Tabs

Below the chart, two tabs provide details for crashes and errors:

Crash DetailsThe Crash Details tab lists summary information for each crash type. You can drill downfrom a crash description to display more detailed information. For more information, seeDrilling Down to Crash Details [p. 36].When you select All Platforms in the Mobile Platforms list, the following columns aredisplayed:

• Crash Description – The message that describes the crash. The description is retrievedfrom the signal or exception name produced by the operating system.

• Android – The number of sessions during which the crash type occurred on Androiddevices.

• iOS – The number of sessions during which the crash type occurred on iOS devices.

• Affected Users – The number of users affected by the crash type or error type.

When you select Android or iOS in the Mobile Platforms list, the following columnsdisplay data from devices running the selected platform:

• Crash Description – The message that describes the crash. The description is retrievedfrom the signal or exception name produced by the operating system.

• Occurrences – The number of times the crash type occurred.

• Affected Users – The number of users affected by the crash type or error type.

The following figure shows the table with All Platforms selected.

35Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 5 ∙ Viewing Application Data

Page 36: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Error DetailsThe Error Details tab lists information for each error type.When you select All Platforms in the Mobile Platforms list, the following columns aredisplayed:

• Error Message – The description of the error as specified in the report error event.

• Error Number – The error message number as specified in the report error event.

• All Platforms, Android, and iOS – The number of times the crash type occurred onall platforms, on Android devices, and on iOS devices.

• Affected Users – The number of users affected by the crash type.

When you select Android or iOS in the Mobile Platforms list, the following columnsdisplay data from devices running the selected platform:

• Error Message – The description of the error as specified in the report error event.

• Error Number – The error message number as specified in the report error event.

• Occurrences – The number of times the crash type occurred.

• Affected Users – The number of users affected by the crash type.

The following figure shows the table with All Platforms selected.

Drilling Down to Crash DetailsDrill down from the Crash Details table in the Availability tab to review details of crashes,including stack traces.

Crash: Session Logs

Click an item in the Crash Description column to drill down to information about the usersessions in which the selected crash occurred.

Mobile Application Monitoring - Free Edition Android ADK User Guide36

Chapter 5 ∙ Viewing Application Data

Page 37: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

The crash description, Application name, and Crash Type are listed at the top of the window,which also contains the following information:

User Session LogThe User Session Log table contains the following columns:

• User ID – The user ID assigned by the application to associate events with that specificuser. A user ID may be listed more than once if that user had multiple sessions duringwhich the crash occurred.

• Session Start Time – The date and time when the session began.

• Crash Occurred At – The date and time when the crash occurred.

• Stack Trace – Click the icon to display the Stack Trace tab in a popup window, asdescribed below, for the selected crash occurrence.

• Events in Sequence – The number of lifecycle events that were completed duringthe session in which the selected crash occurred.

Event SequenceSelecting a row in the User Session Log displays a thumbnail of the event sequence. Thethumbnail lists the last 10 events that were completed, with the crash name at the bottomof the list. The right side of the thumbnail is a waterfall chart of the event timeline.To hide all events that are not actions, select Show Actions Only below the thumbnail.Click the More Details link below the thumbnail to display the Event Sequence tab,which provides additional information as described below.

To return to the Availability tab, click Availability in the top left corner.

Stack Trace Tab

The Stack Trace tab displays identifying details for the selected session, and the first 10 linesof the session's stack trace.

Session DetailsThe session details section provides the following information:

• Crash – The crash description.

• User ID – The user ID assigned by the application to associate events with that specificuser.

• Session Start Time – The date and time when the session began.

• Crash Occurred At – The date and time when the crash occurred.

Click Device Information to display the following details:

• Mobile Platform – The device platform: iOS or Android. If the application is runningon a device simulator, the operating system is listed.

• Device – The model and version of the mobile device.

• Battery Level – The battery strength as a percentage of the full charge, reported asa decimal number 0.00 through 1.0, where 1.0 = 100% charged. If the applicationis running on a device simulator, the battery strength will be zero.

37Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 5 ∙ Viewing Application Data

Page 38: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

• Memory Usage – Percentage of total available memory.

• Signal Strength – Signal strength measured in dBm. Signal strength is only availablefrom Android devices. If the application is running on a device simulator, no signalstrength will be listed.

• Number of Apps Running – The number of applications that were active when thecrash occurred.

• Carrier Network – The network through which the device is connected to the cellularnetwork or the Internet.

Stack TraceThe application name and version, and the crash type, are displayed above the lines fromthe stack trace.

Use the Previous and Next links in the top right corner to display information for other sessionswithout returning to the User Session Log table.To close the window, click the close icon ( X ) in the top right corner.

Event Sequence Tab

The Event Sequence tab displays the crash description, user ID, and session start time for theselected session. It contains a table that provides the following information for each event:

• The sequence number.

• The event name and event type.

• A bar in the Timeline waterfall chart that graphically depicts the relative start time andduration.

• The start date and time for the event.

• The duration of the event. A horizontal line indicating “no available data” is displayed forevents that have no time duration.

The final row in the table lists the crash description. The Timeline and Duration columns forthe crash display solid red lines. The Start Time column lists the date and time when the crashoccurred.To hide all events that are not actions, select Show Actions Only below the table.Use the Previous and Next links in the top right corner to display information for other sessionswithout returning to the User Session Log table.To close the window, click the close icon ( X ) in the top right corner.

Analytics Tab

Chart

The Analytics chart displays:

• A Sessions bar graph with data for each time interval when data was collected.

• A Users line graph with data points for each time interval when data was collected.

Mobile Application Monitoring - Free Edition Android ADK User Guide38

Chapter 5 ∙ Viewing Application Data

Page 39: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

The total number of users and the total number of sessions for the selected time period aredisplayed to the left of the chart.

NOTEA user or session may be represented in multiple intervals. Adding all the intervals togethermay give a different number than the total, which is the unique users or sessions over the selectedtime period. A user that has more than one session is only counted once.

A session starts when the application is first launched or is activated, and ends when theapplication is stopped or is inactive for 5 minutes. Each user may have more than one session.

Details Tabs

The tabs below the chart provide additional detail about users and sessions:

DemographicsThe pie charts provide demographic information about the application's users.

• Users by Platform – The percentage users using devices with each detected platform.

• Users by Region – The percentage of users in each detected geographic region.

• Network Protocol Usage – The percentage of users connected via each detectedprotocol.

• Carrier Usage – The percentage of users connected through each detected carrier.

Hover over a section of a pie chart to see a tooltip that displays the percentage and theactual number of users (or occurrences of a protocol or carrier) that it represents.

NOTEIf any names in the chart legends are truncated, the tooltip will display the full name.

39Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 5 ∙ Viewing Application Data

Page 40: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Session Length DistributionThe Session Length Distribution tab contains a bar graph that enables you to see thetypical session length for your application. The x-axis lists session durations ranging from0–3 seconds through 10+ minutes. The y-axis measures the number of sessions for eachduration.For example, you may see that most sessions lasted 3–5 minutes, which is what you wouldexpect for application use. If, however, the graph shows an unexpectedly large numberof sessions that lasted only 4–10 seconds, this may indicate that an error occurs within 10seconds of starting the application.

Event Tracking Tab

Chart

The Event Tracking chart displays bar graphs that depict the number of report value events(reportValue()) and report events (reportEvent()) that occurred at each interval duringthe selected time period. For more information, see Methods for Instrumentation [p. 15].To the left of the chart, you can see the total number of events and the number of each type ofevent for the selected time period.

Table

The Event Tracking Details table provides information about the events.When you select All Platforms in the Mobile Platforms list, the following columns aredisplayed:

• Event – The name of the lifecycle event, specified when the application was instrumented.

• Event Type – The event type designation, and the data type (e.g. String) if applicable.

• Data Value – The data returned by the selected report value event.

Mobile Application Monitoring - Free Edition Android ADK User Guide40

Chapter 5 ∙ Viewing Application Data

Page 41: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

• All Platforms – The number of times this event occurred on both Android and iOS devices.

• Android – The number of times this event occurred on Android devices.

• iOS – The number of times this event occurred on iOS devices

• Users – The number of users that accessed the selected event.

When you select Android or iOS in the Mobile Platforms list, the following columns displaydata from devices running the selected platform:

• Event – The name of the lifecycle event, specified when the application was instrumented.

• Event Type – The event type designation, and the data type (e.g. String) if applicable.

• Data Value – The data returned by the selected report value event.

• Occurrences – The number of times this event occurred on devices with the selectedplatform.

• Users – The number of users that accessed the selected event.

The bars next to the values in each column provide a visual indication of the relative values,for example, which events have occurred most often or least often.The following figure shows the table with All Platforms selected.

Profile PageIn the My Profile page, you can review or update your personal information and select whetherto receive email related to Compuware products.To display this page, click the My Profile link at the top right of the Mobile ApplicationPerformance or Support page.You cannot change your username, account name, or access level. You can update your nameand address, change your password, and select different challenge questions for login security.At the bottom of the page, you can select whether to receive emails from Compuware to stayinformed about technical information, product upgrades and releases, corporate news, andbenchmark information. All email options are selected by default. If you do not want to receiveany category of email, clear the check box for that category.After you change any of the information in this page, click Update at the bottom of the pageto save the changes.

41Mobile Application Monitoring - Free Edition Android ADK User Guide

Chapter 5 ∙ Viewing Application Data

Page 42: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Mobile Application Monitoring - Free Edition Android ADK User Guide42

Chapter 5 ∙ Viewing Application Data

Page 43: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

Index

Aadding Android ADK to Eclipse project 11AndroidManifest.xml 9API 15Availability tab

36drilldown 36

Bbest practices 7

Ccarrier data 38collected metrics 27Compuware APM Community 5CompuwareUEM Eclipse plug-in 10CompuwareUEM.registerWebView method 23CompuwareUEM.setMonitorCookie method 15crash reporting

36viewing data 36

Ddata collected 27

EEclipse plug-in 10Eclipse project

11adding Android ADK 11

email options 41enableCrashReporting method 16enterAction method 17

FflushEvents method 22

GgetRequestTag method 22getRequestTagHeader method 22

Hhelp 5

Iinstrumentation 7, 9, 12, 15, 24–25

See also methodsbasic 12best practices 7lifecycle events 25overview 9service application 24

See also methods

LleaveAction method 17lifecycle events 25logging 26

Mmethods

15–23CompuwareUEM.registerWebView 23CompuwareUEM.setMonitorCookie 15enableCrashReporting 16enterAction 17flushEvents 22getRequestTag 22

43Mobile Application Monitoring - Free Edition Android ADK User Guide

Index

Page 44: Mobile Application Monitoring - Free Edition …akamai-cdn.gomeznetworks.com/MobileADK/SR2012/Compuware_APM...Please direct questions about dynaTrace or comments on this document

methods (continued)getRequestTagHeader 22leaveAction 17registerRequestTaggingInterceptor 21reportError

19CompuwareUEM class 19UemAction class 19

reportEvent 18reportValue 18setGpsLocation 23shutdown 16startup 15tagRequest

20–21CompuwareUEM class 21UemAction class 20

uemCaptureStatus 23Mobile Application Performance page

31–34, 38, 40Analytics tab 38Availability tab 34Event Tracking tab 40Performance tab 33Summary tab 33

My Profile page 41

Nnetwork data 38

Ooperating systems 7

Ppassword 41

permissions required 9privacy policy 7

RregisterRequestTaggingInterceptor method 21reportError method

19CompuwareUEM class 19UemAction class 19

reportEvent method 18reportValue method 18return codes 23

Sservice application 24setGpsLocation method 23shutdown method 16startup method 15support 5

TtagRequest method

20–21CompuwareUEM class 21UemAction class 20

UuemCaptureStatus method 23updating personal information 41user demographics 38

Vviewing data 31–34, 38, 40

Mobile Application Monitoring - Free Edition Android ADK User Guide44

Index