This plug-in allows you to send Android AppMeasurement calls from your PhoneGap project. To create a PhoneGap project, see PhoneGap.
Looking for information and documentation related to the Adobe Experience Platform Mobile SDK? Click here for our latest documentation.
As of September 2018, we released a new, major version of the SDK. These new Adobe Experience Platform Mobile SDKs are configurable through Experience Platform Launch.
Run the following command:
cordova plugin add adobe-mobile-services
Drag the ADBMobile_PhoneGap.java file to your src folder.
To move this file, click OK.
Drag the ADB_Helper.js file into the folder that contains the index.html file
To move this file, click OK.
In the res/xml folder, open the config.xml file and register an new plugin by adding the following:
<feature name="ADBMobile_PhoneGap">
<param name="android-package" value="[YOUR_PACKAGE_NAME].ADBMobile_PhoneGap" />
</feature>
For example, if your package is named com.example.phonegaptest, your android-package value would be the following:
<param name="android-package" value="com.example.phonegaptest.ADBMobile_PhoneGap" />
To download the AppMeasurement library, see Get the SDK.
Drag the adobeMobileLibrary.jar file to your src folder.
To move this file, click OK.
Right-click the adobeMobileLibrary.jar file and select Add as Library.
Based on the requirements of your project, enter the name, level, and location for the library.
Drag the ADBMobileConfig.json file to your assets folder in the application root.
Confirm that you have selected the root application and not an application in an application.
To move this file, click OK.
The AppMeasurement library requires the following permissions to send data and record offline tracking calls:
INTERNETACCESS_NETWORK_STATETo add these permissions, add the following lines to your AndroidManifest.xml file, which is 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:
<activity
android:name="com.adobe.mobile.MessageFullScreenActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<receiver android:name="com.adobe.mobile.MessageNotificationHandler" />
If you select modal layout when you create a message in Adobe mobile services, select one of the following themes:
Theme.Translucent.NoTitleBar.FullscreenTheme.Translucent.NoTitleBarTheme.TranslucentFor example:
<activity
android:name="com.adobe.mobile.MessageFullScreenActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<receiver android:name="com.adobe.mobile.MessageNotificationHandler" />
In html files, add the following to the <head> tag where you want to use tracking:
<script type="text/javascript" charset="utf-8" src="ADB_Helper.js"></script>