Architecture : What do i REALLY need ? (Part — 1) – Android thru my lens !! – Medium

Pain of every Android developer.

As app developers we need to often make complex decisions, which architecture to have (MVC, MVP,MVVM or something else), which DB to use (Room, Sqlite or something else).

This is an attempt to help budding Android developers what and what not to use and how to decide if a particular library is good or bad for there team/project.

Do I really need an Architecture in my app?

I am sure you and you client’s won’t like the end product look like this.Trust me, YOU DO need an app architecture for any production app.

Everyone loves to see code (or veggies in a supermarket), only if they are nicely structured/aligned.

Often with teams working on ecommerce apps or apps having long user flows, it is very obvious to run into the below issues :

  • Absolute Zero/not sufficient coverage by Unit Tests.
  • Debugging hell for new devs on the team
  • Difficulty for peers.
  • Regression takes heaps of time.
  • Developers take too much time/effort even for minor fixes.

If you wanna get rid of any/all of the above mentioned issues — please invest time in setting up an architecture for your app first (even if it is very basic).You gotta remember :

You can’t have a good app unless you have a good architecture.

MVC, MVP, MVVM, VIPER, Redux → What the Hell ?

I have met a lot of devs having a fight on :

MVC vs MVP vs MVVM vs arch components vs RX vs Redux vs VIPER vs fragment-less architecture vs uncle bob vs what not.

Everyone trying to prove that the architecture they use is best and easy and cool and every other architecture out there is crap and outdated and bla bla bla and bla bla bla……

There is nothing like good and bad architecture.The choice of arch really depends on

  • What the app is all about / what the UX is like ?
  • What the capabilities of the team are ?
  • How important is unit testing for the team/project ?
  • Do you want to build a scalable product ?

Based on the above questions you can decide which one to go for.

I will be sharing another article soon on different architecture patterns on Android and which one to pick under what scenarios.

Do i really need a networking library, if yes which one ?

Trust me on this, you do need a networking library on android , while making API calls.

I still remember initial days of android development, when i was using http connection class and manually writing a parser class to parse some 400 key, value pairs, which i was getting back from a REST API as JSON.

That was pretty scary and if you do slightest of spelling mistake — the app crashes.

Volley came to the rescue at that time and yeah i starting enjoying the networking stuff again.

As of today we have the luxury of using Retrofit okHttp and few other libs available + Jackson /GSON to help us with parsing. Life just became so much easier, Thank you Jake Wharton.

So my 2 cents : no matter what, use retrofit, it is simple, easy to setup, easy to debug/log using interceptors , goes well with RX and gives you peace of mind.

More coming in the next part……


Please enter your comment!
Please enter your name here