At slice, we’ve bi-monthly android meeting and while discussing how we can improve our codebase, someone suggested dagger-android to hilt migration. The first thing we asked is why do we need to do so. In our codebase, dagger-android was working “perfectly” but we all know the complexities that it brings like when implementing factories for AndroidX libraries like ViewModels and WorkManager. For example, suppose we have a repo class that needs to be injected in viewmodel. …
Recently, I’ve finished a course “Dependency Injection in Android with Dagger 2 and Hilt” by Vasiliy Zukanov from Udemy and it is one of the best courses I’ve ever taken. He has explained everything from why do we need dependency injection to how to use Dagger and hilt for the same. He literally refactored a project from everything in an activity to providing all services using DI. This article is not about the implementation of an DI framework, it’s about my learnings and understanding about the fundamentals of DI from this course.
Consider a basic analogy for this. Suppose you…
If you’re reading this article, I assume you’re in the quest for investments and you want to grow your savings for your short or long-term goals. And if you are a beginner, this article can help you to at least form a perspective about the different investment options.
TL;DR: If you don’t know much about investing, always avoid emotions and try to ask as many questions as possible to at least get enough confidence to invest like how much return it’ll give after maturity, or can you stop in between and what happens then. …
Remember, when your teacher always interrupted you to avoid doing something wrong. We always had two choices, either to ignore it (not realizing its importance) or to consider it for our better future.
Lint is quite similar to our teachers, it’ll alert you while you’re writing your code and let you know how you can fix them. Isn’t it amazing?
If you’re an android developer, there is a high chance that you’ve heard of Data Binding.
Pre-requisite: It’ll be good if you’re already familiar with normal or one-way data-binding.
So, what is two-way data binding?
In one-way data binding, you set a value on an attribute and set a listener that reacts to a change in that attribute. But two-way data binding allows you to directly react to the changes without using listeners.
Let me give you an example. I recently had to add a feature in one of my company’s projects where we ask users to fill some details…
Have you heard of a story in which an old man fixes a ship engine by just tapping with a hammer? Well, if not then you can read it here.
There is a beautiful quote mentioned in the story:
“Effort is important, but knowing where to make an effort makes all the difference!”
Okay, let’s discuss how this is related to our discussion.
So, the android team recently announced in-app review API and its integration is quite simple. You just have to add a dependency in your app-level gradle file:
And, add this code to launch the review…
We all have used fragments in our app and wrote fragment transactions many times according to our needs. So, the navigation component is another way to handle transactions but it provides few other benefits too.
Some of them are:
Okay, now let’s discuss how to integrate it into our app.
First, we’ve to add following dependencies in our app-level
def nav_version = "2.3.0"
The recommended way to navigate between destinations…