Android SDK Setup

Installation

LivePinch Android SDK is hosted on jcenter Maven repository. To integrate add dependency of LivePinch in app/build.gradle file.

dependencies {
   compile 'com.livepinch:sdk:2.3.2'

   // For Offline Tracking
   api 'android.arch.persistence.room:runtime:1.1.1'
   annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
}

And add following maven url to project.gradle . Example:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://dl.bintray.com/livepinch/LivePinch-AndroidSDK"
        }
    }
}

Initialization

Get License Keys from the dashboard and place it in the Android Manifest file like below:

<meta-data
         android:name="com.livepinch.sdk.LICENSEKEY"
         android:value="$LICENSE_KEY" />

$LICENSE_KEY here is a placeholder, replace this with the actual License Key obtained from the dashboard. See Here to see how to obtain the keys.

And Register Life Cycle callbacks to LivePinch sdk as below,

public class ApplicationClass extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    registerActivityLifecycleCallbacks(new LivePinchActivityLifeCycleCallbacks());
  }
}

And declare following service to track events happening when the app is not active to share data (Like: OfflineMode, Receive Push,etc..)

<service
       android:name="com.livepinch.sdk.EventLoggerService"
       android:exported="false" />

Proguard Rules

Include the following rules in your ProGuard file, If you have enabled minify in release mode.

-keep class com.livepinch.sdk.**{*;}
-dontwarn com.livepinch.sdk.**