Android SDK

northDASH ingests native Android App events using the opensource Mixapanel Android SDK –

Step 1 – Add the mixpanel-android library as a gradle dependency:

dependencies {
    implementation ''

Step 2 – Add permissions to your AndroidManifest.xml:

  android:name="android.permission.INTERNET" />

  android:name="android.permission.ACCESS_NETWORK_STATE" />

  android:name="android.permission.BLUETOOTH" />

Initializing the Library

Initialize the code by calling MixpanelAPI.getInstance. You can add this code to your onCreate method.

public static final String NORTHDASH_TOKEN = "YOUR_TOKEN";

// Set the events endpoint
final MPConfig mpConfig = MPConfig.getInstance(this);

// Initialize the library with your
// northDASH integration token, NORTHDASH_TOKEN, and a reference
// to your application context.
MixpanelAPI mixpanel =
     MixpanelAPI.getInstance(context, NORTHDASH_TOKEN);

Flushing Events

The SDK keeps a queue of events that are sent in batches to preserve bandwidth and battery life. Add this to flush events for when the app closes.

 protected void onDestroy() {

Sending Events

Once the code is initialized you can send events like this:

JSONObject props = new JSONObject();
 props.put("Gender", "Female");
 props.put("Plan", "Premium");

mixpanel.track("Plan Selected", props);
Did you find this helpful?10