Showcasing Android Tech Stack

Freeletics has published four Android apps (Bodyweight, Running, Gym, Nutrition) as part of its product strategy. These apps collectively help everyone in the world unleash their full physical and mental potential and become the greatest version of themselves. We’re extremely proud of them, but at the same time, we owe a tremendous debt of gratitude to the communities that built the tools that made it possible.

From all of us at Freeletics, #ClapClap and Thank you!

A Little Background

Freeletics is a sport where you train with your own bodyweight only. It started off as a PDF-focused product back in 2013 and has grown into a flourishing Web and Mobile product. Choosing a tech stack is a commitment that’s not easily reversed, so future circumstances like scalability and performance should be considered. It’s also important to avoid compromising on user experience because there’s nothing more vital to an app than looking great and working smoothly. Despite being a tech company, we treat user experience as not just a part of design, but as an integral part of our product strategy.

Various technical factors have influenced our selection criteria for frameworks and libraries at different phases of the product’s development. We have had our fair share of experiments and setbacks, but we’ve always learnt from our mistakes and evolved our stack along with the product.

The information about our Android stack shared below is what we have right now, but we strongly believe in the words of Heraclitus, “change is the only constant in life.” The best is yet to be!

Java, SDK, Gradle and Support Library

For our Bodyweight app, we shifted to Java 8 last year but only use the bits of Java 8 supported by our minSdk, which doesn’t include everything. The rest of the apps will be moved in near future.

We try our best to stay current with the very latest versions of the Android SDK (currently 25.0.2), Gradle (currently 2.3.1), and Support libraries (currently 25.1.1). We strongly recommend that you always compile with the latest Android SDK. You’ll get all the benefits of new compilation checks on existing code, avoid newly deprecated APIs, and be ready to use new APIs. Furthermore, if you use the Support Library, compiling with the latest SDK is a requirement for using the latest Support Library release. Similarly, for Gradle, staying up to date is important. The Gradle update page says, “For the best performance, you should use the latest possible version of both Gradle and the Android plugin.” Hence it makes sense to update as soon there’s a new version.

Third Party Libs


This section outlines major third-party libraries for Android we already use in our projects. Each has different purpose and goal but all of them make our lives as developers much more pleasant.

Here are some key considerations to keep in mind while deciding which third-party library to use:

If you are interested in exploring other important libraries, please check out these resources (1, 2 and 3.) We hope they are helpful.

General


Name Description
Guava Guava is a set of core libraries for Java from Google
Arrow Arrow is Lightweight library toolbox for Java and Android Development
Ixjava Iterable Extensions for Java, the dual of RxJava. Originally implemented in the Reactive4Java framework, now converted to work with RxJava
Dagger2 A fast dependency injector for Android and Java
Device Year Class A library that analyzes an Android device’s specifications and calculates which year the device would be considered “high end”

We currently have Guava along with Arrow and Ixjava but this will change soon as we are already in process of replacing Guava with Ixjava and Arrow. Guava is being slowly replaced by other libraries, specially since Java 8’s Stream API was introduced. IxJava has functional programming style which is very similar to RxJava and something we already use. Additionally, Guava is a monolith library and gives more reasons to use Arrow which is like a compact version of Guava.


Debugging


Name Description
Timber A logger with a small, extensible API which provides utility on top of Android’s normal Log class
DebugOverlay A tiny window overlay to log app internal on top of your android app
LeakCanary A memory leak detection library for Android and Java
Process Phoenix Process Phoenix facilitates restarting your application process
Screengrab Automated localized screenshots of your Android app on every device
Stetho Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more
ACRA Library enabling Android Application to automatically post their crash reports to a report server


Code Generation / Reducing Boilerplate code


Name Description
AutoValue AutoValue is a great tool for eliminating the drudgery of writing mundane value classes in Java
Butter Knife Field and method binding for Android views
DeepLinkDispatch A simple, annotation-based library for making deep link handling better on Android


Reactive


Name Description
RxJava Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM
RxAndroid Android specific bindings for RxJava 2. This module adds the minimum classes to RxJava that make writing reactive components in Android applications easy and hassle-free
RxBinding RxJava binding APIs for Android UI widgets from the platform and support libraries
RxRelay Relays are RxJava types which are both an Observable and a Consumer
RxLifecycle Lifecycle handling APIs for Android apps using RxJava


Images Loading & Caching


Name Description
Picasso A powerful image downloading and caching library for Android


JSON Serialization/Deserialization


Name Description
Gson A Java serialization/deserialization library to convert Java Objects into JSON and back


Custom Views and Animations


Name Description
RecyclerView Animators An Android Animation library which easily add itemanimator to RecyclerView items
SmoothProgressBar A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar
CWAC MergeAdapter Provides the MergeAdapter, a ListAdapter that blends multiple Views or ListAdapters into a single ListAdapter. Use this for section headings, blending multiple sources of data together, etc.
PhotoView Implementation of ImageView for Android that supports zooming, by various touch gestures
Rebound A Java library that models spring dynamics and adds real world physics to your app
ShortcutBadger The ShortcutBadger makes your Android App show the count of unread messages as a badge on your App shortcut!
StickyListHeaders An Android library that makes it easy to integrate section headers in your ListView
Android Tooltip Create Toast like tooltips, physical targets can be specified, or even points on screen
ViewPagerIndicator Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock
Recycler Bubble Provides fast scroll and section idexer for recycler view


Storage


Name Description
Esperando Easy SharedPreference Engine for Android
OrmLite Lightweight Java ORM Supports Android and SQLite
SQLDelight Generates Java models from CREATE TABLE statements

OrmLite is used in one application and SQLDelight in another newer one.


Network


Name Description
OkHttp An HTTP & HTTP/2 client for Android and Java applications
Okio Okio is a library that complements java.io and java.nio to make it much easier to access, store, and process your data
Retrofit A type-safe HTTP client for Android and Java. It uses annotation to describe HTTP server calls which is an elegant solution for managing REST API calls in an android application.


Testing


Name Description
AssertJ Core AssertJ core is a Java library that provides a fluent interface for writing assertions. Its main goal is to improve test code readability and make maintenance of tests easier
DaggerMock A JUnit rule to easily override Dagger 2 objects
DeviceAnimationTestRule A JUnit rule to disable and enable device animations
Espresso Espresso is a UI test framework (part of the Android Testing Support Library) that allows you to create automated UI tests for your Android app
Mockito Mockito is a mocking framework that lets you write beautiful tests with a clean & simple API
Robolectric Robolectric is a unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app.
Spoon Distributing instrumentation tests to all your Androids

We are using DaggerMock but we are moving away from this because it adds complexity and most recent Dagger versions allow us to do what we are trying to achieve with DaggerMock.


Again, thank you! 👏