Coder Social home page Coder Social logo

uxcamptest's Introduction

Android Test Analytics SDK

Description

Basic analytics features are implemented to track events with properties!

Integrate Test Analytics SDK

Prerequisites

  1. To build a project using the Analytics SDK for Android, you need version Android Studio Flamingo | 2022.2.1 or later of Android Studio.
  2. Developers with knowledge of Java and Kotlin

SDK Compiled With

  • Android Studio Hedgehog | 2023.1.1
  • Target and Compile version 34

Integration Steps

  1. Copy the Analytics module and paste on your root directory

  2. Add the following code on setting.gradle file

  include(":analytics")   

  1. Add the following code to your app build.gradle file
implementation(project(":analytics"))
  1. Add below line inside android block in app's build.gradle
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
  1. Initialize the SDK and start the analytics session
    AnalyticsSDK.Builder().chukkerEnable(false).apiKey("").appVersion("1.0.1").environment(ENVIRONMENT.DEBUG).build().start(this)

To add events and properties use the following function

val event = Event("AppLaunched", mapOf("action" to "launched", "label" to "launched an app"))
        AnalyticsSingleton.addEvent(event)

//Where Event is a data class from Sdk
data class Event(
    val name: String,
    val properties: Map<String, Any>
)

To end the analytics session use the following function.

      AnalyticsSingleton.stopSession()

Parameters:

  1. apiKey - Unique key to access SDK but you can use a random string or "" too(String).
  2. appVersion - Version of your app to track version-related data on analytics(String).
  3. chuckerEnabled - This is for logging API hits to debug API request response you can set false for now(Boolean).
  4. environment - Current app environment like UAT,DEBUG etc for now i have added 4 enums value enum class ENVIRONMENT { PRODUCTION, DEBUG, UAT, PREPRODUCTION } #Note all the parameters are mandatory for now.

uxcamptest's People

Contributors

v-athapa avatar amirthapa avatar

Watchers

 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.