Photo by Compare Fibre on Unsplash

Im almost 100% sure that you've heard the words “MVC”, “MVP”, “MVVM”, “MVI”, Mv whatever 🤷 when you where searching for development resources. In order to understand MVVM we need to go to the basics. (Don't worry I will go straight to the point).

WHAT’S THE PROBLEM?

When we start with android development, we tend to put all our logic inside of our Activities, Fragments, Views, etc.

So at the end, our “views” tend to do more than just render the UI. …

Photo by La-Rel Easter on Unsplash

Modularization is not a recent topic at all. This concept have been around us for years! but probably there are some folks around there that didn’t saw or heard from it till now. Today, my goal is to make sure you have a better understanding of modularization by the end of this article, and I’ll hope you’ll try it as soon as possible.

Let me divide this blog in 5 sections (Don’t worry, as with my other blogs, I’ll go straight to the point).

Monolithic world 👶

Photo by Joey Kyber on Unsplash

⚠️ This not a tutorial article. This is more a manifesto of how I feel using the jetpack navigation library in modularized projects. The pros, the cons & the alternatives to it. You can agree or disagree with me, leave your thoughts in the comments. Also, it is important to highlight that I’m focusing the content for navigation of Fragments/Activities, not with Composables. I Haven’t try the navigation library in Composables yet.

Navigation between feature modules is one of the challenges you’re going to face when you are in the process of modularize your project.

When I started, there wasn’t…

Photo by Oğuzhan Akdoğan on Unsplash

In the previous post, we’ve got familiarized with unit testing. Now is the turn for test our UI’s.

What are Instrumented tests? 🤔

Instrumented tests are tests that run on physical devices and emulators, and they can take advantage of the Android framework APIs and supporting APIs, such as AndroidX Test.

Official documentation.

Our goal with instrumented tests is to verify the “actions” that the user can perform like clicking a button, writing on a EditText, or verify if some views are visible or not on a given view state.

Once we have our unit tests running successfully we know that our methods works as…

Photo by Pawel Nolbert on Unsplash

Tests, unit tests, instrumented tests, medical tests, etc. Yeah yeah yeah… You heard that you need to test your code but you think that doing it is going to take more time than you expected, or probably you are thinking that testing is too hard, or the worst of all the options, you didn’t even try.

Well my friend, tests are NOT hard at all and you have to stop avoiding them. They can probably be tedious to set up (usually the instrumented ones) but hard… mmm no, I don’t think so.

Why do I even need to “test” my code? 🤔

Let’s assume we are making some “Shopping App”…

Photo by Fotis Fotopoulos on Unsplash

So this is it. The end of this small series. If you haven’t seen the first two parts, here are the links to it.

Quick Recap!

First of all, congrats for having progressed this far 👏.

  • We needed an extension for make retrofit calls safety ✔️.
  • We needed a way to parse the exceptions and return them into human readable objects✔️.
  • We needed to return a a success or a failure as result✔️.

And now we are going to add our middleware. This functionality will allow us to prevent the execution of the retrofit calls if any of its conditions is not…

Photo by Fotis Fotopoulos on Unsplash

Hello again 👋, this is the second part of the series. If you haven’t read the first part, I encourage you to do it in order to understand all the things we are going to do now.

Now that we know how do we have to handle exceptions with coroutines, lets code.

1. Set up or project ⚒️

We gonna use Retrofit and coroutines for this, therefore we are going to add the following dependencies to our app (or android/kotlin library) module gradle file

dependencies {  // Current versions at the time
def retrofit_version = "2.9.0"
def coroutines_version = "1.5.0"

implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"

Photo by Fotis Fotopoulos on Unsplash

Hello 👋, today Im going to teach you how to execute network calls with retrofit in a safe and kotlin idiomatic way. At the end of this small series you could end up with something like this:

Here you have a Clean Architecture structure from the data layer to the domain layer and the presentation layer.

The gist from above is showing you how is executed the retrofit call and handle the result failure or success in your ViewModel / Presenter/ etc. …

Photo by BENCE BOROS on Unsplash

Haven’t you asked how does Facebook, Instagram, Twitter, Forbes, etc… let you “scroll infinitely” without reach a “end” of information in their apps? Wouldn’t you like to implement something like that?

This “endless scrolling” feature is commonly called “Pagination” and it’s nothing new. In a brief resume, pagination help you to load chunks of data associated with a “page” index.

Let’s assume you have 200 items to display in your RecyclerView. What you would do normally is just execute your request, get the response items and submit your list to your adapter. We already know that RecyclerView by it’s own…

Photo by Glenn Carstens-Peters on Unsplash

Hola, tal vez no has escuchado de nosotros antes, somos Loop, y estamos aquí para ayudarte a no quedarte atrás en este boom digital que atraviesa el país.

No es noticia nueva cómo afectó 🔗el COVID-19 a muchos emprendimientos y empresas con muchos años en el mercado. Esta situación actual nos pone los siguientes retos:

  • Público ausente, ya que prefieren quedarse en casa por miedo a contagiarse.
  • Personal limitado para disminuir el riesgo de contagio entre colaboradores.
  • Locales obligados a restringir el aforo.
  • Largas colas en los exteriores ocasionan que clientes y posibles clientes se vean afectados por el tiempo…

Christopher Elias

Android Software Engineer | Android Blogger | 1st Place at Apps Up 2020 | Surf passionate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store