Coder Social home page Coder Social logo

master-starcloud / mixpanel-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mixpanel/mixpanel-android

0.0 2.0 0.0 28.21 MB

Official Mixpanel Android SDK

Home Page: http://mixpanel.com/

License: Other

Python 0.16% Shell 0.57% Java 99.27%

mixpanel-android's Introduction

Mixpanel Android Library

Latest Version Build Status

May 10, 2019 - v5.6.1

Table of Contents

Quick Start Guide

Check out our official documentation for more in depth information on installing and using Mixpanel on Android.

Installation

Dependencies in app/build.gradle

Add Mixpanel and Firebase Messaging (optional, for push notifications) to the dependencies section in app/build.gradle

implementation "com.mixpanel.android:mixpanel-android:5.+"
implementation "com.google.firebase:firebase-messaging:17.3.4"

Permissions in app/src/main/AndroidManifest.xml

<!-- This permission is required to allow the application to send events and properties to Mixpanel -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- This permission is optional but recommended so we can be smart about when to send data  -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- This permission is optional but recommended so events will contain information about bluetooth state -->
<uses-permission android:name="android.permission.BLUETOOTH" />

Integration

Initialization

Initialize Mixpanel in your main activity app/src/main/java/com/mixpanel/example/myapplication/MainActivity.java. Usually this should be done in onCreate.

String projectToken = YOUR_PROJECT_TOKEN; // e.g.: "1ef7e30d2a58d27f4b90c42e31d6d7ad" 
MixpanelAPI mixpanel = MixpanelAPI.getInstance(this, projectToken);

Remember to replace YOUR_PROJECT_TOKEN with the token provided to you on mixpanel.com.

Tracking

After installing the library into your Android app, Mixpanel will automatically collect common mobile events. You can enable/ disable automatic collection through your project settings.

With the mixpanel object created in the last step a call to track is all you need to send additional events to Mixpanel.

mixpanel.track("Event name no props")

JSONObject props = new JSONObject();
props.put("Prop name", "Prop value");
props.put("Prop 2", "Value 2");
mixpanel.track("Event name", props);

I want to know more!

No worries, here are some links that you will find useful:

Have any questions? Reach out to [email protected] to speak to someone smart, quickly.

Want to Contribute?

The Mixpanel library for Android is an open source project, and we'd love to see your contributions! We'd also love for you to come and work with us! Check out our opening positions for details.

Changelog

See wiki page.

License

See LICENSE File for details. The Base64Coder,
ConfigurationChecker, and StackBlurManager classes, and the entirety of the
 com.mixpanel.android.java_websocket package used by this
software have been licensed from non-Mixpanel sources and modified
for use in the library. Please see the relevant source files, and the
LICENSE file in the com.mixpanel.android.java_websocket package for details.

The StackBlurManager class uses an algorithm by Mario Klingemann <[email protected]>
You can learn more about the algorithm at
http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html.

mixpanel-android's People

Contributors

patedit avatar yinfeiru avatar joeatwork avatar jbwyme avatar ttrefren avatar al63 avatar dneralla avatar gmerinojimenez avatar yarneo avatar hypeastrum avatar cokeperez avatar yogurtearl avatar kevinmost avatar gmale avatar argenisf avatar folkyatina avatar anas-ambri avatar cleberhenriques avatar joeymalysz avatar madster26 avatar mreichelt avatar vanniktech avatar andproger avatar dbachelder avatar imcleary avatar juanchospotify avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.