Skip to content

alexxxdev/AnalyticsTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4189cd1 · Jan 23, 2018

History

12 Commits
Dec 14, 2017
Jan 23, 2018
Dec 14, 2017
Dec 14, 2017
Dec 25, 2017
Dec 25, 2017
Dec 14, 2017
Dec 14, 2017

Repository files navigation

AnalyticsTracker

Annotation based tracking handler

Using

buildscript {
  repositories {
	  maven { url 'https://jitpack.io' }
	}
  dependencies{
    implementation 'com.github.alexxxdev:AnalyticsTracker:1.1.0'
    kapt 'com.github.alexxxdev:AnalyticsTracker:1.1.0'
  }
}
@Analytics
class AnyAnalytics : AnalyticsHandler {
    override fun send(name: String, attrs: Map<String, Any?>) {
        ...
    }
}
class Foo {
    @AnalyticsAttr
    val id:Int,
    @AnalyticsAttr("name")
    var name:String
    ...
}
val foo = Foo()
AnalyticsTracker.send("event name", foo)

or

AnalyticsTracker.send("event name")
AnalyticsTracker.send("event name", mapOf(...))