Git Product home page Git Product logo

younghai / rudder-sdk-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rudderlabs/rudder-sdk-android

0.0 1.0 0.0 1.1 MB

Repo for RudderStack's Android SDK - which allows you to track and send your event data from your Android apps to your desired destination platforms via RudderStack.

Home Page: https://www.rudderstack.com

License: MIT License

Java 94.97% Kotlin 4.96% Shell 0.07%

rudder-sdk-android's Introduction

Download

What is RudderStack?

RudderStack is a customer data pipeline tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.

More information on RudderStack can be found here.

RudderStack Android SDK

The RudderStack Android SDK allows you to track event data from your Android apps. After integrating this SDK, you will also be able to send the event data to your preferred destinations such as Google Analytics, Amplitude, and more.

Getting Started with the RudderStack Android SDK

  1. Add these lines to your app/build.gradle
repositories {
  maven { url  "https://dl.bintray.com/rudderstack/rudderstack" }
}
  1. Add the dependency under dependencies
implementation 'com.rudderstack.android.sdk:core:1.0.10'

Initialize RudderClient

val rudderClient: RudderClient = RudderClient.getInstance(
    this,
    <WRITE_KEY>,
    RudderConfig.Builder()
        .withDataPlaneUrl(<DATA_PLANE_URL>)
        .build()
)

or (compatible with existing Segment code)

RudderClient.Builder builder = new RudderClient.Builder(this, <WRITE_KEY>);
RudderClient.setSingletonInstance(builder.build());

Send Events

rudderClient.track(
    RudderMessageBuilder()
        .setEventName("some_custom_event")
        .setProperty(
            TrackPropertyBuilder()
                .setCategory("test_category")
                .build()
        )
        .setUserId("test_user_id")
)

or (compatible with existing Segment instrumentation code)

String customEvent = "some_custom_event";
String propertyKey = "some_property_key";
String propertyValue = "some_property_value";
RudderClient.with(this).track(
        customEvent,
        new RudderProperty().putValue(propertyKey, propertyValue)
);

For more detailed documentation check the documentation page.

Register your callbacks

For device mode destinations, you can register callbacks, which will be executed after the native SDK has been successfully initialized. Use the onIntegrationReady method to register your callback.

The following snippet shows an example:

rudderClient.onIntegrationReady("Lotame") {
  var nativeSDK  = (it as LotameIntegration)
  // your custom code
}

The variable it contains the intialized nativeSDK object.

Note: The method onIntegrationReady accepts two arguments- the integration name(eg. "Lotame") and the callback.

Registering Lotame's onSync callback shows one more example of registering a callback using onIntegrationReady.

Contact Us

If you come across any issues while configuring or using the RudderStack Android SDK, please feel free to start a conversation on our Slack channel. We will be happy to help you.

rudder-sdk-android's People

Contributors

arnabp92 avatar arnab-p avatar dhawal1248 avatar ruchiramoitra avatar dhawal-rudder avatar ameypv-rudder avatar desusai7 avatar soumyadebm avatar

Watchers

James Cloos 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.