PhoneGap Plug-in

PhoneGap Plug-in

This plug-in lets you send Android AppMeasurement calls from your PhoneGap project.

For help creating a PhoneGap project, see PhoneGap Getting Started with Android.

To download the most-recent plug-in, see the release page in our GitHub account.

This section contains the following information:

Include the Plug-in

  1. Drag onto your src folder. Click OK to move this file.
  2. Drag ADB_Helper.js into the folder that contains index.html (assets > www). Click OK to move this file.
  3. In the res/xml folder, open config.xml and register an new plugin by adding the following:

    <feature name="ADBMobile_PhoneGap">
      <param name="android-package" value="[YOUR_PACKAGE_NAME].ADBMobile_PhoneGap" />

    For example, if you package is named com.example.phonegaptest, then your android-package value would be the following:

    <param name="android-package" value="com.example.phonegaptest.ADBMobile_PhoneGap" />

Include the AppMeasurement Library

To download the AppMeasurement library, see Get the SDK.

  1. Drag adobeMobileLibrary.jar onto your src folder. Click OK to move this file.
  2. Right-click adobeMobileLibrary.jar and select Add as Library.
  3. Provide the name, level, and location for the library based on the requirements of your project.
  4. Drag ADBMobileConfig.json onto your assets folder in the application root. Confirm that you have selected the root application and not an application within an application.

  5. Click OK to move this file.

Add App Permissions

The AppMeasurement Library requires the following permissions to send data and record offline tracking calls:


To add these permissions, add the following lines to your AndroidManifest.xml file (in the application project directory):

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

To enable in-app messaging:

Update AndroidManifest.xml to declare the full screen activity and enable the Message Notification Handler:

android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<receiver android:name="" />

If you select modal layout when you create a message in Adobe mobile services:

You must also specify the theme for the message:

android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<receiver android:name="" />

You can specify Theme.Translucent.NoTitleBar.Fullscreen, Theme.Translucent.NoTitleBar, or Theme.Translucent.

Implement Custom Tracking

In html files where you want to use tracking, add the following to the <head> tag:

<script type="text/javascript" charset="utf-8" src="ADB_Helper.js"></script>

That's it, you are now ready to make measurement calls. See PhoneGap Plug-in Methods.

  • PhoneGap Plug-in Methods
    List of Android PhoneGap Plug-in Methods: Configuration, Tracking, Target, Acquisition, Audience Manager, and Visitor ID Service.