Skip to content

First of all!

Michael edited this page Aug 6, 2017 · 4 revisions

Get library


Basic Usage

To start with gathering analytics:

  1. Create an group or category interface and fill it with necessary annotations:
@Prefix
interface SampleInterface {
    fun method1()
    @NoPrefix fun method1(@Label(LabelConverter::class) String label)
}

or

interface SampleGroupInterface {
    @Prefix fun method1(): SampleInterface1
    @Convention(NamingConventions.LOWER_CAMEL_CASE) fun method2(): SampleInterface2
}

For more information about interfaces and annotations read linked sections.

  1. Prepare Ganalytics instance through: For group interfaces:
val ganalytics = Ganalytics({ System.out.print(it) }) {
     cutOffAnalyticsClassPrefix = false
     prefixSplitter = "_"
     namingConvention = NamingConventions.LOWER_SNAKE_CASE
     labelTypeConverters += TypeConverterPair<DummyDataClass> { it.name } +
             TypeConverterPair<DummyReversedClass> { it.id.toString() } 
}

For category interfaces:

val ganalytics = GanalyticsSettings {
    cutOffAnalyticsClassPrefix = false
    prefixSplitter = "_"
    namingConvention = NamingConventions.LOWER_SNAKE_CASE
    labelTypeConverters += TypeConverterPair<DummyDataClass> { it.name } +
            TypeConverterPair<DummyReversedClass> { it.id.toString() }
}.createSingle { System.out.print(it) }
  1. Pass an interface class to ganalytics: val analytics = ganalytics.create(SampleGroupInterface::class)

For more info of basic usage see samples folder in project.

л

Clone this wiki locally