The Interceptd SDK is available via:
JCenter AAR
Interceptd SDK is available as an AAR via JCenter; to use it, add the following to your
build.gradle.
repositories {
jcenter() // includes Interceptd SDK
}
dependencies {
// Be sure that you are using latest versionimplementation'com.ntrcptd.sdk:analytics:<latest-version>'
}Minimum supported SDK version is 14. Be sure that minSdkVersion in your gradle file isn't lower than 14.
Kotlin Users
importcom.ntrcptd.ntrcptdsdk.InterceptdAnalyticsJava Users
importcom.ntrcptd.ntrcptdsdk.InterceptdAnalytics;Interceptd SDK is required for tracking. Application cannot track any information before SDK initialization is complete.
In application’s onCreate function of the initial activity, call InterceptdAnalytics.initialize function with applicationId parameter. This parameter should be your application id from Interceptd User Dashboard, you can use your application id for integration purposes. Check the following codes for sample:
Kotlin Users
overridefunonCreate(savedInstanceState:Bundle?) {
super.onCreate(savedInstanceState)
InterceptdAnalytics.initialize("your-user-id")
}Java Users
@OverrideprotectedvoidonCreate (BundlesavedInstanceState) {
super.onCreate(savedInstanceState);
InterceptdAnalytics.Instance.initialize("your-user-id");
}Using Interceptd SDK, you are able to track the frequency of custom events by placing the following code piece into your own application code. You can also attach data to your events. Only JSONObject is accepted as data. If you are planning to put an object as a value in JSONObject, make sure the object is JSON serializable.
Kotlin Users
InterceptdAnalytics.track(eventName:String)
InterceptdAnalytics.track(eventName:String, data:JSONObject)Java Users
InterceptdAnalytics.Instance.track(StringeventName);
InterceptdAnalytics.Instance.track(StringeventName, JSONObjectdata);Interceptd SDK logging level can be changed with setLogLevel after InterceptdAnalytics.initialize call. Default is <ASLog.Level.DEBUG>.
Kotlin Users
InterceptdAnalytics.setLogLevel(<ASLog.Level>)Java Users
InterceptdAnalytics.Instance.setLogLevel(<ASLog.Level>);Interceptd Mobile Team