The CleverTap Android SDK for App Personalization and Engagement
CleverTap is the next generation app engagement platform. It enables marketers to identify, engage and retain users and provides developers with unprecedented code-level access to build dynamic app experiences for multiple user groups. CleverTap includes out-of-the-box prescriptive campaigns, omni-channel messaging, uninstall data and the industry's largest FREE messaging tier.
For more information check out our website and documentation.
-
Sign Up
Sign up for a free account.
-
Install the SDK
Copy the included CleverTapAndroidSDK.jar file to your projects libs directory. Add this JAR file as a dependency for your Android app project.
-
Add Your CleverTap Account Credentials
add the following inside the
<application></application>
tags of your AndroidManifest.xml:<meta-data android:name="CLEVERTAP_ACCOUNT_ID" android:value="Your CleverTap Account ID"/> <meta-data android:name="CLEVERTAP_TOKEN" android:value="Your CleverTap Account Token"/>
Replace "Your CleverTap Account ID" and "Your CleverTap Account Token" with actual values from your CleverTap Dashboard -> Settings -> Integration -> Account ID, SDK's.
-
Setup the Lifecycle Callback - IMPORTANT
Add the "android:name" property to the
<application>
tag:<application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:name="com.clevertap.android.sdk.Application">
Note: If you've already got a custom Application class, call
ActivityLifecycleCallback.register(this);
beforesuper.onCreate()
in your custom Application class.Note: The above step is extremely important and enables CleverTap to track notification opens, display in-app notifications, track deep links, and other important user behavior.
-
Initialize the Library
The instance returned by
CleverTapAPI.getInstance()
is the same on every call. In the onCreate() of your main activity:CleverTapAPI ct; try { ct = CleverTapAPI.getInstance(getApplicationContext()); } catch (CleverTapMetaDataNotFoundException e) { // handle appropriately } catch (CleverTapPermissionsNotSatisfied e) { // handle appropriately }
CleverTapMetaDataNotFoundException is thrown when you haven't specified your CleverTap Account ID and/or the Account Token in your AndroidManifest.xml. CleverTapPermissionsNotSatisfied is thrown when you haven't requested the required permissions in your AndroidManifest.xml
-
Checkout the Full Documentation
Please see our full documentation here for more information on permissions, as well as configuration for Push Notifications, In-app messages, install referrer tracking and app personalization.
Checkout the example StarterProject.