10 libraries every Android developer should know about

Original author: Domagoj Korman
  • Transfer

10 libraries every Android developer should know about

In 2015, we already published an article about the five best libraries we used at the time. However, the Android platform has grown significantly since then. As you know, in such a rapidly developing area as software development, everything changes and develops at lightning speed. That is why we decided it was time to update the list of the most effective Android libraries.

Let's go straight to our list without long prefaces. First, we will look at one of the oldest, but, in my opinion, and one of the most efficient Android libraries.

1. Retrofit

Retrofit is a type-safe HTTP client that allows you to present your REST API as an interface. You can manage bodies, headers, API request parameters and much more with annotations, which will make this process simple and straightforward. Retrofit also allows you to perform synchronous and asynchronous API calls.

  @GET("movie/{id}")fungetMovieDetails(@Path("id") id: String) : Call<MovieDetails>

On top of that, Retrofit provides a separate Rx module. If you use Rx, this module will return Observable when accessing the API, which allows you to associate it with the rest of your application. And these are just some of the many reasons why we still love and use Retrofit.

2. Moshi

Moshi is a library for converting JSON to Java and Kotlin objects. Many perceive Moshi as GSON 3.0. However, this library is superior to GSON in several aspects: it is faster , it supports Kotlin, it is updated, it generates predictable exceptions, and it does not use a corrupted DateTime adapter by default. In addition, using Moshi, the process of converting JSON into Java objects (and vice versa) becomes as simple and understandable as possible.

val moshi = Moshi.Builder().build()
val jsonAdapter = moshi.adapter(Model::class.java)/* JSON to Model */val model = jsonAdapter.fromJson(json)
/* Model to JSON */val json = jsonAdapter.toJson(model)

We also love Moshi for supporting the JSON API. The JSON API is a build API specification, and many of the APIs we work with are written using this specification. Moshi JSON API makes our lives easier because the JSON API response is converted to meaningful Java objects. Retrofit still supports Moshi, and together they work just fine.

3. Chuck

Chuck is an HTTP inspector for Android that allows you to “dig” into the HTTP history of your application on a mobile phone. The HTTP log is displayed as a notification, which can be deployed to log into Chuck and view detailed information. Using Chuck is incredibly pleasing to the QA department because they can see where the problem is: on the Android side or on the server side. This library can sometimes help you more than logcat. This is due to the fact that your HTTP history will be preserved even in the event of an unexpected shutdown of the application, while logcat will self-clean from time to time after restarting.


4. Glide

You most likely know that uploading images to Android causes great difficulties. Even resizing an image can be a disaster OutOfMemoryException. Glide is an image loading library that provides a quality API that allows you to change the image as you like.


The library allows you to easily upload a deleted image to ImageView, determine stub images, cache and scale images, etc. Just try to do all this without the help of Glide, and you will immediately understand why it is in our list of key libraries. Glide even supports some common default changes, such as creating an image of a round shape.

5. ThreeTen

ThreeTen is a library for working with date and time in Android. This is a ported version of JSR-310, which was included in Java 8 as a standard package java.time.*. We love this library, because the standard Android Calendar API turns work into a real nightmare.

/* Current DateTime */LocalDateTime.now()
/* String to DateTime */val localDateTimeString = "2011-12-03T10:15:30"val localDateTime = LocalDateTime.parse(localDateTimeString)

ThreeTen is inferior to JodaTime in terms of the number of methods and binary size. The API of this library is also smaller than the JodaTime API. If you are already using JodaTime, then you probably shouldn't switch to ThreeTen. However, I highly recommend trying ThreeTen if you are just starting a new project.

6. Timber

Timber is a powerful but simple logging library built on the basis of the Android class Log. With it, you can easily turn on and off the display of logs. The library also offers excellent support for logging formatted strings and exceptions. Thanks to these advantages, Timber is included in our list of key libraries that we use on almost all Android projects.

/* Log error */
Timber.e("Error happened")
/* Log warning with params */
Timber.w("Your variable value is %s", variable)
/* Log exception */try {
} catch (e: Exception) {

7. Room

Room is the official ORM for Android, and this status is justified by several reasons. This library has a convenient API, similar to Retrofit. Room also relies heavily on annotations and standard SQL syntax.

  @Query("SELECT details FROM movies WHERE id = :id")fungetMovieDetails(id: String): MovieDetails

In addition, Room by default includes support for Rx and LiveData, therefore, you can use it as you like. The main advantage of the Room over various ORMs is simplicity. Many ORMs have a much more complex API, to use which you will need to carefully examine all the documentation. Thanks to the standard SQL syntax, Room is extremely easy to understand, which allows you to start working right away without spending a lot of time reading the documentation.

8. RxJava

RxJava - is Java-implementation ReactiveX API, which allows to connect asynchronous tasks and events in the observed (Eng. Observable ) sequence. Users expect modern applications to display data in real time. In other words, they want the information to be updated automatically. It is in this aspect that RxJava will come in handy.

When getting real-time data, it becomes extremely difficult to combine multiple API requests, switch threads, and handle errors. It is here that RxJava perfectly manifests itself, and for this reason we began to use this library. I agree that RxJava may seem confusing and difficult to learn, but this library definitely deserves your time. Even after switching to Kotlin, we continued to use RxJava because of its advantages. In combination with the Kotlin API, it becomes even better thanks to additional features, extensions.

  /* Execute first API calland retry twice if it fails */
  /* Executesecond API calland retry twice if it fails */
  /* Receive successful results and merge them into single model */
  BiFunction<List<Actor>, MovieDetails, Movie> { actors, details -> Movie(details, actors) }
  /* Execute API calls on IO thread */
  /* Receive results on MainThread */
    onError = { /* Handle error */ },
    onSuccess = { /* Handle full movie data */ }

Try to make something similar to the above snippet using simple Java. Come on.

9. Android KTX

Android KTX is a set of wrapper extensions for the Android API in Kotlin that make it more friendly. The main goal of this library is to make the Android API more convenient to use. It contains many methods and excellent new Kotlin functions, such as named parameters, lambda functions and default parameters.

/* Display View */view.isVisible = true/* Apply padding to all sides */view.setPadding(padding)
/* Update padding on any side */view.updatePadding(left = newPadding, right = newPadding)
/* Quick Toast */
toast("Display test toast")
/* New way to create bundle */
bundleOf {
  "key1" to item1
  "key2" to item2
/* Better way to use SharedPreferences */
sharedPreferences.edit {
  putString("key1", "value1")
  putString("key2", "value2")

Android KTX is distinguished by the presence of many feature extensions, and the only way to find out about them is to dive into the library code to see how the functions have improved the Android API. Android KTX makes it easy to use the Android API, and for this reason this library should be the basis of every Android application written in Kotlin.

10. Dagger

Our list of the top 10 libraries would be incomplete without Dagger. This library is a completely static dependency injection framework at compile time. Dagger, like RxJava, is really hard to understand (I had to spend some time to understand their example of CoffeeMaker), but definitely deserves the time and effort spent.

Dependency injection (eng. Dependency injection ) is a way to add small components to other models with minimal effort. For example, if you have a car model, you can add tires to it and easily replace the tire implementation in the future - without changing a single line of code in the car model.

When developing more complex applications, you definitely don’t want to do the dependency injection tasks yourself, because the amount of code increases rapidly and becomes too complicated to support. Dagger will relieve you of this problem, because it creates a dependency injection graph at compile time by processing annotations.

Last year, Google added a separate Android Dagger module that allows you to write less template code and simplifies dependency injection.


So, here it is: our list of the top 10 Android libraries in 2018. Ten great libraries that will make the Android development process more enjoyable for everyone who decides to use them. Want more libraries? It turned out that we in our company have developed several of our own Android libraries. You can read them:

  • MjolnirRecyclerView - adds support for header, footer, empty view components and DiffUtils to RecyclerView;
  • Goldfinger - simplifies the implementation of fingerprint authentication;
  • DBInspector — scans and provides access to application databases;
  • Complexify is a simple way to check the quality of a user password;
  • Prince of Versions - handles application updates within the application.

Also popular now: