solid-kotlin-analytics - SOLID Analytics Interface for Android, written in Kotlin - Kotlin Resources


SOLID Android Client Kotlin Analytics Interface


Writing SOLID Analytics With Kotlin for Android - Medium Article

This library demonstrates how you could decouple analytics libraries from your business logic code, effectively allowing you to:

  • Add & remove analytics services quickly
  • Add & remove events quickly
  • Change event names and parameters according to the required kit

Quick Start Guide

Add To Gradle

Add library to your gradle module

repositories {
    maven { url "" }

dependencies {

    def version = '1.0.19'

    // This is the generic java/kotlin interface
    compile ""

    // This is an android-dependant extension interface
    compile ""
    // then add the kits you need, or implement your own kit/dispatcher
    compile ""
    compile ""
    compile ""
    compile ""
    // Don't forget to add kotlin dependency, if you're in a pure-java project
    implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.2.71


Kotlin Implementation Example

Initiate analytics and send events

// init analytics
analytics = Analytics(settings,
                CustomDispatcher(init = true),
                LoggerDispatcherImpl(init = true, context = this),
                FirebaseDispatcherImpl(init = true, context = this),
                MixPanelDispatcherImpl(init = true, projectToken = "TOKEN", context = this),
                AnswersDispatcherImpl(init = true, context = this)

//              if you're using crashlytics, or any other fabric kit in addition to Answers
//              AnswersDispatcherImpl(init = true, Answers(), Crashlytics())

// send event

Don’t forget to declare the event

class SimpleEvent : CustomEvent {
    // declare name - will be sent to all dispatchers
    override fun getEventName(kit: AnalyticsKit): String = "Simple Event"


Android Highlights

If you’re targeting Android, you need the android package, and you should generally extend AndroidAnalyticsDispatcher and AndroidAnalyticsSettings instead of the kotlin ones.

See more integration examples in the source code

Todo List

  • Setup repository
  • Add Code
  • Upload First Build
  • Add Gradle Example
  • Add Fabric Answers Default Implementation
  • Add Firebase Default Implementation
  • Add Flurry Default Implementation
  • Add Example Code to App Module
  • Add Example Code to README
  • Add Documentation
  • Add Unit Tests
  • Who knows… :o

Originally developed for Wakey - Beautiful Alarm Clock

Wakey is a simple & beautiful animated alarm clock, featuring a spectacular design and an immersive experience - guaranteed to wake you up with a smile everyday!

With our smiling sunrise, and grumpy lunar animations, this is the most unique alarm clock in our solar system.

Wakey Alarm Clock


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
compile ""

Related Libraries


Easy to use and concise yet powerful and robust command line argument parsing for Kotlin

Last updated 3 mins ago


A multi-threaded download tool written with RxJava and Kotlin

Last updated 3 mins ago


LeakCanary is a memory leak detection library for Android.

Last updated 3 mins ago


A Kotlin API for generating .kt source files.

Last updated 3 mins ago


A specification framework for Kotlin

Last updated 3 mins ago