MediaMelon
  • MediaMelon SDK Integration
  • MediaMelon SDK Events
  • MediaMelon Player SDK Integration
    • React Native
      • React Native Video v5.2.0 with Mediamelon SDK
      • React Native Video v6.4.2 with Mediamelon SDK
    • Web SDK
      • VideoJS Web with Mediamelon Analytics
      • VideoJS Web with Google DAI
      • Shaka Player Web v4
      • MediaMelon Web Kaltura Player Plugin Integration Document
      • NexPlayer Web v4
      • THEOPlayer Web
      • JWPlayer Web
      • Radiant Player Web
      • ChromeCast Player
      • HLSJS Player Web
      • HbbTV SDK
      • Comcast PDK 6
      • Bitmovin Web Player
      • HTML5 Player Web
      • Flow Player Web
      • DashJS Player Web
      • Castlabs Player Web
      • Cordova Plugin Toast (Smart TV)
      • Custom Player Web SDK
      • Plyr Player Web with MediaMelon Analytics
      • React Player SDK with IMA
    • Android SDK
      • App Analytics SDK
      • Bitmovin Android v3.73 with Content Provider Metrics
      • Exoplayer v2.13.2 integration with MediaMelon SDK
      • Exoplayer v2.17.1 with Mediamelon SDK
      • Exoplayer v2.12.2 integration with MediaMelon SDK
      • EXOPlayer-Android(V2.14.2) MediaMelon SDK with Google IMA DAI
      • EXOPlayer-Android(V2.17.1) MediaMelon SDK with Google IMA DAI
      • Exoplayer v2.11
      • Exoplayer v2.18.1 with Mediamelon SDK
      • Theoplayer v6.0.0 with Mediamelon SDK
      • Theoplayer v4.12.6 with Mediamelon SDK
      • Theoplayer v7.5.0 with Mediamelon SDK
      • Exoplayer v2.13.3 integration with MediaMelon SDK
      • Kaltura Android Player Integration with Mediamelon SDK
      • Media3 v1.3.0 and ExoPlayer 2.19.1 with MediaMelon SDK
      • Media3 v1.3.1 with MediaMelon SDK
      • MediaMelon Android Media3 v1.1.1 SDK Integration Document
      • Media3Player-Android(V1.3.0) MediaMelon SDK with Google IMA
    • Roku SDK
      • Roku SDK
      • Roku with RAF SDK
      • Roku with IMA SDK
    • iOS SDK
      • AVPlayer (Cocoapods)
      • AVPlayer with Google DAI SDK ( Framework )
      • AVPlayer Quality Of Experience SDK
      • AVPlayer Generic Framework
      • AVPlayer with Google DAI (Cocoapods)
      • Bitmovin iOS v3.44 with Content Provider Metrics
      • THEOPlayer XCFramework
      • THEOplayer (Cocoapods)
      • MediaMelon iOS Kaltura Player Plugin Integration Document
    • tvOS SDK
      • AVPlayer tvOS XCFramework
      • THEOPlayer tvOS XCFramework
    • Toast SDK
    • Custom Player C++ SDK
    • C++ SDK QoE Ads
    • Ad Integrations
      • Google IMA
      • FreeWheel
      • ServerSide.AI
  • SmartSight Analytics
    • Product Features
    • QBR Streaming
  • SmartSight API's
    • API Overview
      • Metric and Dimensions Dictionary
      • General Guidelines
      • Video Experience
      • Ad Experience
      • Smartquery Insights
      • Errors
      • Alerts
    • Use-case dictionary
Powered by GitBook
On this page
  • Prerequisites
  • Step 1: Set up the build environment
  • Step 2: Integrate MediaMelon SDK Code to SampleApp
  • Step 3: Custom Data & Referral Data
  • Step 4 : User Actions
  • Step 4: Report Ended State to the SDK

Was this helpful?

  1. MediaMelon Player SDK Integration
  2. Android SDK

App Analytics SDK

This page describes the integration of the MediaMelon App Analytics SDK

PreviousAndroid SDKNextBitmovin Android v3.73 with Content Provider Metrics

Last updated 8 months ago

Was this helpful?

Prerequisites

  1. Android Sample App

  2. MediaMelon SmartSight SDK appanalytics-release.aar

  3. MediaMelon-assigned Customer ID

If you do not know your Customer ID contact MediaMelon at

Step 1: Set up the build environment

  1. Copy appanalytics-release.aar provided with the release package to SampleApp/appanalytics-release.aar

  2. Add network permissions to

    app/src/main/AndroidManifest.xml

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Step 2: Integrate MediaMelon SDK Code to SampleApp

The application must register the MediaMelon SDK and provide app information once when the application launches. Please note that values provided in this integration step persist across app sessions.

you need to create Application class MyApplication.java

import android.app.Application;
import java.util.HashMap;
import com.mediamelon.appanalytics.MMIntegrationWrapper;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ....
        MMIntegrationWrapper.getInstance(this).initialize("CUTOMER_ID" , "APP_NAME" , "APP_VERSION");
        HashMap<String , Object> userInfoCustomData = new HashMap<String , Object>();
        userInfoCustomData.put("KEY" , "VALUE");
        MMIntegrationWrapper.reportSubscriberInfo("SUBSCRIBER_ID","SUBSCRIBER_TYPE","SUBSCRIBER_TAG","PROFILE_ID",userInfoCustomData);
        ...
    }
    @Override
    public void onTerminate() {
        super.onTerminate();
        MMIntegrationWrapper.release(true);
    }
}

Note: you can rename MyApplication.java according to your application

Now you need to mention in your MyApplication.java AndroidManifest.xml

 <application
        ...
           android:name=".MyApplication"
        ...
   </application>

Step 3: Custom Data & Referral Data

//Report Referral data
HashMap<String,Object> referralCustomData = new HashMap<String,Object>()
referralCustomData.put("REFERAl_KEY", "R_VALUE");
MMIntegrationWrapper.reportReferralInfo("REFERRAL_ID",referralCustomData);

// Report custom data
HashMap<String,Object> customData = new HashMap<String,Object>()
customData.put("KEY","VALUE")
MMIntegrationWrapper.reportCustomData("EVENT_NAME",customData)

Step 4 : User Actions

  • Screen View

HashMap<String,Object> screenData = new HashMap<String,Object>()
screenData.put("KEY","VALUE")
MMIntegrationWrapper.reportScreenView("EVENT_NAME",screenData)
  • Event

HashMap<String,Object> eventData = new HashMap<String,Object>()
eventData.put("KEY","VALUE")
MMIntegrationWrapper.reportEvent("EVENT_NAME",eventData)
  • App State

MMIntegrationWrapper.reportAppState("APP_STATE")
  • App Error

HashMap<String,Object> errorData = new HashMap<String,Object>()
errorData.put("KEY","VALUE")
MMIntegrationWrapper.reportAppError("APP_ERROR" , errorData)
  • Video State

HashMap<String,Object> videoData = new HashMap<String,Object>()
videoData.put("KEY","VALUE")
MMIntegrationWrapper.reportVideoState("VIDEO_STATE" , videoData)
  • Interruption

HashMap<String,Object> interruptionData = new HashMap<String,Object>()
interruptionData.put("KEY","VALUE")
MMIntegrationWrapper.reportInterruption("INTERRUTION_TYPE" , interruptionData)
  • Purchase

HashMap<String,Object> purchaseData = new HashMap<String,Object>()
purchaseData.put("KEY","VALUE")
MMIntegrationWrapper.reportPurchase("PURCHASE_TYPE" , purchaseData)
  • Subscription

HashMap<String,Object> subscriptionData = new HashMap<String,Object>()
subscriptionData.put("KEY","VALUE")
MMIntegrationWrapper.reportSubcription("SUBSCRIPTION_TYPE" , subscriptionData)

Step 4: Report Ended State to the SDK

 MMIntegrationWrapper.release(true);

Variable

Description

CUSTOMER_ID

String containing your MediaMelon-assigned Customer ID.

SUBSCRIBER_ID

String containing your subscriber’s ID. If you do not use subscriber IDs, enter null

SUBSCRIBER_TYPE

String containing the subscriber type (e.g. “Free”, “Paid”). If you do not use subscriber types, enter null

SUBSCRIBER_TAG

String containing an additional subscriber-specific information. This is sent in clear (not hashed) to SmartSight and it is advised to not send sensitive information in this field.

PROFILE_ID

...

REFERRAL_ID

A unique referral id

support@mediamelon.com