In my previous article, I explained how we could build an Android App using Clean Architecture. In this article, I am going to show how to write unit tests for that project using Mockito and Kluent.
Kluent is a “Fluent Assertions” library using the Infix-Notations and Extension Functions of Kotlin to provide a fluent wrapper around the JUnit-Asserts and Mockito. I like Kluent for the reason that it makes my test classes more readable, and it includes a lot of functions to make unit testing easy.
Let’s start by adding dependencies:
Here is the…
In this article, I will explain how to build an Android App using Clean Architecture. For that, I will focus on a specific use case: Get posts from the internet and display them in a recyclerView.
We will fetch posts from this endPoint: https://jsonplaceholder.typicode.com/posts.
We will use:
I will use Kotlin to write the Application. If you are not familiar with clean architecture, please visit this link.
Here is the architecture of the project:
Here is a question I always asked myself. What if someone was coming to me and ask me what do I recommend an Android Developer to know. I decided to write this article to answer that question.
In terms of programming language, any Android developer should know Kotlin since Google has officially adopted it. Kotlin introduces a lot of features that java doesn’t have. Like Null safety, extension functions, and more. You should check those feature comparison here. Also, here is why you should learn Kotlin.
There are many approaches to architecting your Android apps like MVP, MVVM, MVI. …