Scariest Terms for Newbie Android Developer

MVVM | ROOM | Retrofit | Coroutines

Β·

10 min read

Scariest Terms for Newbie Android Developer

Hello World 🌎,

As an Android Newbie, in the early-stage, we thrilled to explore most parts of Android. When we start learning, we start thinking about what exactly we need to learn to become a great developer. In search of an answer to this question, we try everything that is available on the Web. Most of us follow platforms like YouTube, Udemy, Medium, Hash node, and many others.

Generally, our journey is something like πŸ₯³ building Tic-Tac-Toe App, Simple Note Taking App, NewsApp, etc. these apps in our initials. After the basics app, we excited to explore Databases, Firebase, and APIs to use in projects. Here, you'll see the different ways to do the same task.

Some of the tutorials following Architecture Pattern to build the App, some are just following the straightforward trend. You bit confused about what you should follow. Before moving further let's first list out those scariest terms and then I'll back to this.

  • MVVM (Model-View-ViewModel) Architecture
  • Data Binding
  • APIs
  • Retrofit
  • Room
  • Caching
  • Asynchronous & Coroutines
  • RxJava

Is it a correct list?😁 Or I forget to add anything, comment out those that felt scary to you when you started 🧐. I'll tell you in this blog what will be the best time to start implementing these kinds of stuff in your projects.

Let's discuss one by one in the easiest possible way what exactly these things are.

MVVM - As a developer, what you prefer most the clean and organized code or random and unorganized code? If you thought of Clean and Organized Code, here MVVM comes into action. MVVM, a design pattern, helps you in writing clean and well-structured code for the project. Organizing the code so it can be easily maintainable.

Best Time to Start -

  1. When your app has too many features and it keeps incrementing.
  2. App using Local database.
  3. App using data source from any server via APIs.

(P.S. - From my experience first, build 5-6 project straight, and when you comfortable with building these small projects, now you good to go)

Data Binding - The most frequent method you used in your project is findViewById() to get the instance of the UI. Even it feels thrilled when we use this method for the first time😜. Jokes apart, what happens if we don't need to write findViewById() and still get the instance of the UI. Is it possible? Yes, with data binding we can bind UI components in the XML layout with the application's data repository.

For example - Suppose, there's a TextView in your XML layout and you give an id to that TextView is android:id="@+id/textView", instead of putting the id inside findViewById() you can simply call it like bind.textView. Is it easy right?

Best Time to Start - You can start from your first project but it will be good if you start after 2-3 projects.

APIs - You always Google lots of things, Right? When you googling anything, you're actually using an API. But the thing is how? πŸ€” When you type anything on Google and then click on Search, the website connects to the Internet and sends data to the server. Then server retrieves the data, interprets it, performs the necessary actions, and sends it back to you. In the same manner, you will use APIs in your project to build your app to perform a task, show data from the server into your app, authentication, save data to the cloud. 🎧

Best Time to Start - Working with API are beginner-level project, after 2-3 simple project you can start.

Best Time to Start - Try to build an app for network calls without using Retrofit. And then go for it. So you really understand the concept from the core.

Room - What first thought came to your mind when you heard about Room? Room is something where we live. Right? Room in Android is similar to our room. In Android, we store our data in the local database. Room is persistence library provides an abstraction layer over SQLite to allow fluent database access. Suppose you want to create a Note-Taking App, you can use Room DB to create, read, update and delete the data.

Best Time to Start - You can start with a Simple Note Taking App. But first, go with normal SQLite and after then use Room library in your project. Then you'll really feel the top-notch concept of local database in Android.

Caching - Suppose you build an App that contains videos or audio or may be imaged. Unfortunately, the Internet goes offline. How do you feel as a user? It feels a little indifferent, a little frustrated. If you as an Android Developer fixed this problem, it will be really great. And user experience also improved. To solve this kind of problem, Caching came into Action.

Best Time to Start - First explore Retrofit, Room and build real projects and after then come to this one. It not for the absolute beginners. You need to be a little experienced.

Asynchronous & Coroutines - Android Asynchronous is basically AsyncTask. It performs heavy tasks in the background and keeps the UI thread light so apps become more responsive. Suppose, you perform several tasks on a single thread, it slows down the application. Takes a long time to fetch the data. And it makes a non-responsive app. Hence, use of AsyncTask in Android Apps to keep the UI thread responsive all the time.

Coroutines - As AsyncTask is depreciated now, so for multi-threading we can use Coroutines in our app. It's easy to use. It's a design pattern that we can use on Android to specify code that executes asynchronously. It's lightweight, with very few memory leaks.

Best Time to Start - When you build an app that uses Room or Network calls then you can simply put Coroutines to perform network loading in the background thread. Or Inserting data in the background thread.

RxJava - It's a Library uses to perform Reactive Programming in Android. It also uses to perform Multi-Threading. To perform Asynchronous tasks in our app, we can also use RxJava. It makes multi-threading very easy in our project. It helps us to decide on which thread we want to run the task.

Best Time to Start - When you build an app that uses Room or Network calls then you can simply use RxJava to perform network loading in the background thread. Or Inserting data in the background thread.

That's all for this blog post. Your valuable comment is always welcome. If I did any mistake or share any wrong information please let me know. I'll really glad.

If you want to connect, you can ping me on @LinkedIN

Thanks a lot for being here.πŸ€— Prateek