Init and key steps - konstantin-shinkarenko/doc-sample-proj GitHub Wiki

1. Add Conviva libraries to your project / dependencies configuration

NOTE: Add jcenter() repository in your root file to automatically install Conviva dependencies via Gradle.

Add core SDK:

implementation 'com.conviva.sdk:conviva--sdk:4.0+'

If using ExoPlayer, add ExoPlayer module SDK:

implementation 'com.conviva.sdk:conviva-exoplayer-sdk:4.0+'

2. Init ConvivaAnalytics

Init the SDK by initialising ConvivaAnalytics object:

ConvivaAnalytics.init(Context appContext, String customerKey, Map<string, object> settings); 
  • appContext: Android application context;
  • customerKey: String to identify specific customer account. Different keys shall be used for development / debug versus production environment. Find your keys on the account info page in Pulse;
  • settings: Map of Conviva settings to enable debug. Shall NOT be set in production - pass null or skip it.
    The allowed parameters are:
    - ConvivaSdkConstants.GATEWAY_URL: once enabled, your Conviva data will appear in Touchstone;
    - ConvivaSdkConstants.LOG_LEVEL // set to ConvivaSdkConstants.LogLevel.DEBUG for debug-level log verbosity.

Sample code illustrating initialisation with / without debug can be found here.

☞ IMPORTANT: No need to set gatewayUrl and LogLevel settings for your production release explicitly. The Conviva SDK has the right default value.

3. Set Device Metadata

For Android, Conviva detects device metadata automatically. However, if you are implementing Conviva on a Set Top Box or other custom Android device, check the aspects of implementation with your Conviva representative, as it may require providing device metadata explicitly.

4. Init videoAnalytics

// videoAnalytics would be used throughout the integration.
ConvivaVideoAnalytics videoAnalytics = ConvivaAnalytics.buildVideoAnalytics(getApplicationContext());

5. Init adAnalytics

Required only if video application supports Ads (either server-side or client-side).

// adAnalytics would be used throughout the integration.
ConvivaAdAnalytics convivaAdAnalytics = ConvivaAnalytics.buildAdAnalytics(getApplicationContext(), videoAnalytics);

NEXT STEP

⚠️ **GitHub.com Fallback** ⚠️