Android SDK v3.1.x integration

👍

UPDATE!

We have updated our release process for SDK 2, 3 & Product Experience starting 12th April 2021!
Please follow the new guidelines as mentioned below.

To integrate your Android project with Netcore CE Android SDK, follow these steps

📘

Android Project Prerequisites:

  • Target API level 19 or later
  • Use Gradle 4.1 or later

Step 1: Integrate the latest Netcore CE SDK

  1. Make the following changes in the app-level build.gradle
apply plugin: 'com.android.application' android { ... defaultConfig { ... } buildTypes { ... } } repositories { maven { url 'https://artifacts.netcore.co.in/artifactory/android' } } dependencies { implementation 'com.netcore.android:smartech-sdk:3.1.41' } buildscript { }

Note: WorkManager Version 2.7.0 is required for apps targeting Android 12 (S).

  1. Perform Gradle Sync to build your project and incorporate the dependency additions noted above.

Step 2: Initialize Netcore CE SDK

  1. Put your Smartech panel's app Id in the meta-data tag of your application's manifest file.
    To get Smartech App ID, follow steps given here , else please get in touch with your account manager to get the value of SMT_APP_ID
<meta-data android:name="SMT_APP_ID" android:value="YOUR_SMARTECH_APP_ID_HERE" />
  1. Add the below mentioned code in the onCreate() method of your Application class to initialize the Smartech SDK.
@Override public void onCreate() { super.onCreate(); Smartech.getInstance(new WeakReference<>(context)).initializeSdk(this); }
override fun onCreate() { super.onCreate() Smartech.getInstance(WeakReference(applicationContext)).initializeSdk(this) }
  1. Make sure you have registered your Application class in the Application tag inside the manifest.xml file.

Step 3: Choose Features

Now that the basic setup is completed, you can choose to move to either of below features:

  1. Customer Engagement Channels like Push Notifications & In-app Messages
  2. User & Event Tracking

Did this page help you?