Posts

Showing posts from February, 2019

Kotlin Clean Architecture

Image
A strong base architecture is extremely important for an app to scale and meet the expectation of the user base. I got a task of replacement of API with new updated and optimized API structure. For integrating this kind of change made me kind of rewrite the whole app. Why? Because the code was  deeply coupled  with response data models. At this time, I didn’t want to make the same mistakes over and over again. For resolving this problem, Clean architecture came to the rescue. It is a bit pain in the starting but might be the best option for a large app with many feature and  SOLID  approach. Let’s just try by questioning every aspect of architecture and break down into simpler bits. news-sample-app Contribute to news-sample-app development by creating an account on GitHub. github.com This architecture was proposed in 2012 by Robert C. Martin(Uncle Bob) in  clean code blog . Why the cleaner approach? Separation of code in different layer...

Android Networking in 2019 — Retrofit with Kotlin’s Coroutines

Image
The year 2018 saw a lot of big changes in the Android World, especially in terms of Android Networking. The launch of a stable version of Kotlin Coroutines fueled a lot of movement from RxJava to Kotlin Coroutines for handling multithreading in Android. In this article, we will be talking about making Networking API calls in Android using  Retrofit2  and  Kotlin Coroutines . We will be making a networking call to  TMDB API  to fetch popular movies. I know all these concepts, Show me the code!! If you are experienced with Android Networking and have made networking calls before using Retrofit but probably with other libraries viz RxJava, instead of Kotlin Coroutines and just want to check out the implementation,  check out this code readme on Github. Android Networking in Nutshell In a nutshell, android networking or any networking works in the following way: Request—  Make an HTTP request to an URL (called as endpoint) with ...