Install the Adobe Experience Platform Mobile SDK

In this lesson, you will implement the Mobile SDK with the extensions and settings corresponding to your tag property’s Development environment.


Adobe Experience Platform Launch is being integrated into Adobe Experience Platform as a suite of data collection technologies. Several terminology changes have rolled out in the interface which you should be aware of while using this content:


In this lesson we will start adding code to the Bus Booking app, so if you haven’t already done so:

  1. Download and Install Android™ Studio
  2. Download the Bus Booking app

Learning Objectives

At the end of this lesson, you will be able to:

  • Obtain the installation instructions for your mobile tag property
  • Understand the difference between a Development, Staging, and Production environment
  • Update your build.gradle file to add the Mobile SDK
  • Import the Mobile SDK into your app
  • Verify that the SDK has been implemented successfully
  • Enable Lifecycle Metrics in the app

Get the Installation Instructions

The Installation Instructions for mobile tag properties are a collection of code snippets that you add to specific locations in your mobile app.

Click on the Environments tab in the top navigation to go to the environments page. Note that Development, Staging, and Production environments have been pre-created for you. These correspond to the typical environments in the code development and release process. Code is first written by a developer in a Development environment. When they have completed their work, they send it to a Staging environment for QA and other teams to review. Once the QA and other teams are satisfied, the code is then published to the Production environment, which is the public-facing environment which your visitors experience when they download your app.

Tags permits additional Development environments, which is useful in large organizations in which multiple developers are working on different projects at the same time.

Development, Staging, and Production are the only environments we need to complete the tutorial.

Click Environments in the top nav

In the Development row, click the Install icon Install icon to open the embed code modal.

Click the icon to open the embed code modal

Let’s go through the instructions step-by-step.

Update the build.gradle file

If you have previously used tag properties in websites, one of the first things you will notice is that there are a lot more installation instructions for mobile apps than for websites.

The Adobe Mobile SDK for Android uses Gradle to manage dependencies between its various components. One of the first things we will do is add the Adobe Mobile SDK dependencies to the Bus Booking app’s build.gradle file.

To update the build.gradle file

  1. Open Android™ Studio

  2. Select “Open an existing Android™ Studio Project”

    Select "Open an existing Android™ Studio Project"

  3. Open the build.gradle file at the root of the Bus Booking Android™ folder:

    Open the build.gradle file at the root of the Bus Booking Android™ folder

  4. Open the dropdown and switch to the Project view

    Select "Project" from the dropdown

  5. Open the Android > bus > build.gradle file

    Open Android > bus > build.gradle

  6. In the Data Collection interface, make sure the operating system is set to Android

  7. Copy the dependencies to your clipboard, by clicking the Copy icon

    Copy dependencies to your clipboard in the Data Collection interface

  8. In Android™ Studio, paste the dependencies from your clipboard right after the existing dependencies (but before the closing })

  9. Click the “Sync Now” link to sync the project

    Paste dependencies in to build.gradle

Update the Application

Now it’s time to update the App to import the SDK

To import the SDK

  1. Open the Main Application file in the Bus Booking app, which is located at Android > bus > src > main > java > com.adobe.busbooking > DemoApplication

    Open DemoApplication

  2. In the Data Collection interface, scroll to the Add Initialization Code section.

  3. Copy the import statements, by clicking the first Copy icon in the Add Initialization Code section:

    Copy the import statements to your clipboard

  4. In Android™ Studio, paste these import statements before the existing imports in the DemoApplication file. Note that the Core extension includes libraries to support callbacks, the identity service, lifecycle metrics, and console logging among other features.

    Paste the import statements into your DemoApplication file

  5. In the Data Collection interface, copy the two lines related to the Core extension, by clicking the second Copy icon in the Add Initialization Code section. The second line turns on console logging statements (available options are).

    Copy the Core statements to your clipboard

  6. In Android™ Studio, paste these Core statements into the DemoApplication file right after super.onCreate()

  7. Remove the // comments before the try and catch lines

    Paste the Core statements into your DemoApplication file

  8. In the Data Collection interface, copy the extension statements, by clicking the third Copy icon in the Add Initialization Code section.

    Copy the Extension statements to your clipboard

  9. In Android™ Studio, paste these extension statements into the try section. Note that MobileCore.configureWithAppID contains the identifier of the tags development environment of your property. This is important, as you will need to update this value when we are ready to deploy the app to the production environment.

    Paste the Extension statements into your DemoApplication file


The Mobile Install Instructions provided in the Data Collection interface include the import and registration statements for Identity, Lifecycle, and Signal extensions, as well as the initialization of the Lifecyle metrics. These extensions are considered part of the Mobile Core extension. If you do not wish to use these extensions in your app, you do not need to import, register, or implement other code associated with these extensions.

Also, there are additional implementation options which should be considered when using these extensions (for example, you could pause/restart Lifecycle collection when the user backgrounds/foregrounds the app). You can read more about this in the Mobile Core extension documentation

Verify the implementation

  1. Save your Android™ Studio project

  2. Run the app and launch it in the Emulator. If you don’t have any emulator devices configured, configure one now, being sure to configure a device running Android 4.1 (API 16) or later.

    Run the app and launch it in the emulator

  3. Wait for the Emulator to launch and fully open the app to the booking screen (this may take a few minutes)

    Wait for the app to fully open

  4. Confirm that calls are being made to the Adobe servers in the Android™ Studio Logcat

    Wait for the app to fully open

Here are examples of some specific calls you can look for:

  1. Calls to retrieve the tags configuration (filter Logcat to Note the extension configurations which you entered in the earlier lesson. While adding the extension requires an update to the app, these settings can be managed externally in tags and changed at any time:

    03-14 16:30:29.484 24869-24930/com.adobe.busbooking D/ADBMobile: ConfigurationExtension - Cached configuration loaded.
  2. Request to the Identity Service (filter Logcat to IdentityExtension) In this example, the ID (d_mid) has already been set and is just being reported up again)

    03-14 17:01:18.526 7743-7803/com.adobe.busbooking D/ADBMobile: IdentityExtension - Sending request (
  3. Analytics request (filter Logcat to AnalyticsExtension)

    03-14 17:01:18.509 7743-7777/com.adobe.busbooking D/ADBMobile: AnalyticsExtension - Sending Analytics ID call (

Congratulations, you’ve added the SDK to a mobile app!

Enable Lifecycle Metrics in the App

Lifecycle metrics are environment-based metrics and dimensions that can be easily enabled in an app using the Experience Platform Mobile SDK. Since they can be used by multiple Experience Cloud solutions, we will enable them here, before we move deeper into the individual solutions. This is as simple as adding a couple lines of code to our app in the right place.

Import the Core Library into the BusBookingActivity File

In order to make API calls via the Adobe Experience Platform Mobile SDK, you need to import the libraries into the appropriate files. In this case, to utilize the Lifecycle API call, we need to import the Core library.

  1. With your app open in Android™ Studio, open the BusBookingActivity file, which is in the same directory as the DemoApplication file that you’ve been working in.
  2. At the top of the file, add the following MobileCore import statement so that you can use the associated API calls

Import the Mobile Core Library

Add the Lifecycle Code

You will now add the Lifecycle code to the main onResume() function in the app, in order to trigger the Lifecycle functions.

  1. Open the BusBookingActivity file

  2. Scroll down near the bottom of the file and locate the onResume() function

  3. Add the following two lines of code under the super.onResume() line:


Insert Lifecycle Code

Validate the Lifecycle Hit

When you run your app, you should now get one or more Lifecycle messages in the debug section of Android™ Studio.

  1. Run a build, and choose a simulator to run the app
  2. After the simulator is up and running, click to the “Run” section of the debugger in Android™ Studio
  3. Do a search for internalaction=Lifecycle
  4. See that there are lines that include this key/value pair, as well as the other Lifecycle metrics.

Note that lines you’ll see are actually Analytics calls with Lifecycle metrics.

Validate Lifecycle

Next “Add the Adobe Experience Platform Identity Service” >

On this page