-
Notifications
You must be signed in to change notification settings - Fork 4
First of all!
Michael edited this page Aug 6, 2017
·
4 revisions
To start with gathering analytics:
- 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.
- 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) }
- Pass an interface class to
ganalytics
:val analytics = ganalytics.create(SampleGroupInterface::class)
For more info of basic usage see samples folder in project.
л