Edit in GitHubLog an issue

Get the Adobe Experience Platform Mobile SDK

The Adobe Experience Platform SDK is available for Apple iOS (includes iOS, iPadOS, and tvOS) via Cocoapods and Swift Package Manager, and for Google Android via Gradle.

Follow the directions below to include the SDK into your mobile application.

  1. Select the tag property you created earlier in the Data Collection UI.
  2. In your tag property's details page, Select the Environments tab on the left nav. The Environments tab lists the different environments where you can publish, e.g. Development, Staging, and Production.
  3. Select the install package icon (under INSTALL column) for the appropriate environment row. You should see a dialog box titled Mobile Install Instructions.
  4. On the open dialog box, select the appropriate platform tab Android or iOS.
  5. Copy the necessary dependencies and initialization code from the dialog box to your mobile application project.

Latest version of the Adobe Experience Platform SDKs for Android supports Android 5.0 (API 21) or later.

Installation instructions

If you cannot access the Mobile Install Instructions dialog box in the Data Collection UI, complete the following sections to get the Adobe Experience Platform SDK. If you already completed the steps in the Mobile Install Instructions dialog box, no need to complete these steps.

1. Add dependencies to your project

Each extension needs to be added as a dependency to the mobile application project. The following examples will add the Mobile Core and Profile extensions.

Add the dependencies to build.gradle for each extension.

Copied to your clipboard
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
implementation 'com.adobe.marketing.mobile:userprofile'
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:identity'
implementation 'com.adobe.marketing.mobile:signal'
implementation 'com.adobe.marketing.mobile:lifecycle'

2. Add initialization code

Next you'll need to import SDK libraries into your project and register them for initialization. Extensions are registered with Mobile Core so that they can dispatch and listen for events.

The following code snippets demonstrate how you can import and register the Mobile Core and Profile extensions. You can also see, for reference, how Identity, Lifecycle, Signal, Profile, and other extensions are imported and registered.

After you register the extensions, call the start API in Mobile Core to initialize the SDK as shown below. This step is required to boot up the SDK for event processing. The following code snippet is provided as a sample reference.

Java

Copied to your clipboard
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Assurance;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.Extension;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.adobe.marketing.mobile.edge.consent.Consent;
import com.adobe.marketing.mobile.edge.identity.Identity;
import java.util.Arrays;
import java.util.List;
...
import android.app.Application;
...
public class MainApp extends Application {
...
@Override
public void on Create(){
super.onCreate();
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.DEBUG);
...
List<Class<? extends Extension>> extensions = Arrays.asList(
Consent.EXTENSION,
Assurance.EXTENSION,
com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,
com.adobe.marketing.mobile.Identity.EXTENSION,
Edge.EXTENSION,
UserProfile.EXTENSION,
Lifecycle.EXTENSION,
Signal.EXTENSION
);
MobileCore.registerExtensions(extensions, new AdobeCallback () {
@Override
public void call(Object o) {
MobileCore.configureWithAppID("<your_environment_file_id>");
}
});
}
}

Java (Direct Boot enabled)

Copied to your clipboard
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Assurance;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.Extension;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.adobe.marketing.mobile.edge.consent.Consent;
import com.adobe.marketing.mobile.edge.identity.Identity;
import java.util.Arrays;
import java.util.List;
...
import android.app.Application;
import androidx.core.os.UserManagerCompat; // Access features in android UserManager in backwards compatible manner
...
public class MainApp extends Application {
...
@Override
public void on Create(){
super.onCreate();
if(UserManagerCompat.isUserUnlocked(this.getApplicationContext())) {
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.DEBUG);
...
List<Class<? extends Extension>> extensions = Arrays.asList(
Consent.EXTENSION,
Assurance.EXTENSION,
com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,
com.adobe.marketing.mobile.Identity.EXTENSION,
Edge.EXTENSION,
UserProfile.EXTENSION,
Lifecycle.EXTENSION,
Signal.EXTENSION
);
MobileCore.registerExtensions(extensions, new AdobeCallback () {
@Override
public void call(Object o) {
MobileCore.configureWithAppID("<your_environment_file_id>");
}
});
}
}
}

3. Ensure app permissions (Android only)

For Android, the SDK requires standard network connection permissions in your manifest to send data, collect cellular provider, and record offline tracking calls.

To enable these permissions, add the following lines to your AndroidManifest.xml file, located in your app's application project directory:

Copied to your clipboard
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Watch the Video

Additional information

Get help

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.