Integration
To add your app to your dataset in the Personalization UI, do the following.
-
Log in to the Personalization UI and select the desired dataset.
For an initial integration, we recommend using a non-production dataset.
-
From the left-hand menu, choose Mobile > Native App Setup.
If this feature is disabled for your dataset, contact the Personalization support team to enable it.
-
In the Platform dropdown menu, select Android.
-
Enter a name for your app under App Name.
-
Enter the Android
applicationId
(from the app'sbuild.gradle
) under ApplicationId. -
Click Create New App.
You can add up to 8 native apps to a single dataset. However, deleting an app doesn't free up space for a new one.
To add the Personalization SDK to your app, do the following.
-
In your project-level
build.gradle
file, includegoogle()
andmavenCentral()
in your repository list, as shown in the following example. -
In your app's module-level
build.gradle
file, include the latest version of Personalization as a dependency, as shown in the following example.
For sample code to call in your Application.onCreate()
implementation to initialize and start the Personalization SDK, see the Evergage
class documentation.
To effortlessly manage test campaigns from the device in debug/debuggable builds, you must configure the app to use its Personalization-generated URL Scheme. For more information, see EvergageActivity
.
You can use other methods to add information about the user. In the initialization example code, calling setUserId
provides Personalization with the user's authenticated ID. If the user's ID is unknown at startup, you could call this method later to then send the user's ID with subsequent events.
Only supported by recent versions of Android Studio and Gradle.
Android Studio automatically downloads and attaches the Personalization Android SDK sources. Press the Command key (OSX) or Ctrl key (Windows) and click a non-internal Personalization class or method to go to the declaration and view the source.
If sources were not automatically added, you could manually attach the -sources.jar
by doing the following.
- Download the
-sources.jar
from Maven Central. - On the left sidebar, open the Project Pane and select the Project view from the dropdown menu. The default view is Android.
- Under External Libraries, right-click the Personalization library (evergage-android-sdk-1.4.0) and select Library Properties.
- Click the + icon in the bottom left corner.
- Select the downloaded JAR file and click OK.
You can follow the same steps to attach the -javadoc.jar
file and view the documentation locally. You could also view the documentation locally by downloading the -javadoc.jar
from Maven Central and opening index.html
.
- To get started with tracking events and sending them from your app to Personalization, see Tracking.