
Lead Android Developer
Aditi ConsultingLead Android Developer
Saveo Healthtech Pvt LtdSoftware Developer
Navi Technologies Pvt LtdAndroid Studio

Android SDK
Riaz Ahmed, I have worked nearly four years and eight months of experience in Android development. Currently, I'm working in a company named SaverhillTech. We are of I'm working as a lead render developer where I manage all the applications in our system. And what the application does is it's an e-commerce application where you can buy medicines from distributors. So, I manage the whole application right now, and I was the first developer to work on it. I started the app with Zoom, and I made it to where it is today. Prior to this, I worked with Navi Technologies, which is a Fintech application. I joined the member team from scratch and later made it to the next stage for development, and then I made it live with the team. The next three months were a plan to make it stable, and after that, yeah, that's pretty much it from the start of my career. I also worked on open-source projects, where I contributed to graph and boilerplate API codes. Currently, as a side project, I'm working on a navigation scheme for JETAC composers, which is working on Android. So, I really keep exploring new stuff and other things in the Android world. Yeah. That's pretty much about it, about me. Thanks a lot.
In this scenario, would you use frame your work and set it up by. So, frame the scenarios where you want some more layouts to be in front of each other, maybe in the form of stock. So, in those scenarios, most of the time you use frame the audience to construct your customer. Most of the complex layouts where it takes a lot of computation to align items according to the constraints from one view to another view. So, the pieces where frame layout is better, where you have a stack of items. And at that point of time, you probably try to use a stack because that gives some more better performance because it does not have a very constrained layout where you have to be reliant on other users, come at the top of each other.
I can manage different requests. Okay. So in Android, mostly what I try to use is coroutines with dispatchers to make it work. So I try to use that thing with the MVI pattern. So I tried to use coroutines in every model scope, so that I can make different API calls. I verify one of those to be hit Adily multiple, it has to be hit badly or maybe not valid and maybe in a sequential manner. I definitely use coroutines with the supervisor. And then I will consume that in your model and emit that to a State view, and then create something to show to the UI. And coroutines help you to manage all your tasks, which is in the scope of your new model. So that if your model is destroyed, all the tasks which are already happening in your new model will also get destroyed.
Or do you ensure atomic transitions in local? Okay. So how can I make a common transition? So from this question, I can think of a single transaction signal point in time where I can then introduce multiple queries into one transaction and use the Room database. And I'll try to make sure that only one print single thread is used. I will use a single instance of the database variable and avoid locks to lock all the queries. So only one execution can be executed at a single point in time, and multiple threads should wait. If some other task is happening in the database for a right query. So, that's how you can have atomic transactions in the local database.
Oh, would you know, mitigate your conflicts and get welcomed in the last couple. So, avoid this thing. Usually, you would create a main branch where all contributors can create a new branch out of it. And then, what we usually do is make changes to our code in our own branch. At the end of the project, or at the completion of that feature, I try to pull the recent code from the server. And if there are conflicts, it gets more complex. I try to resolve those conflicts at that time. I pull that into my code. If you have a very big feature, a good way to do it is to keep pulling from the main branch every day or two, so you'll get an updated code base. And at the end of the feature, you won't have to make a lot of decisions about which changes to take and which to reject. So if you keep doing it, you will face fewer merge conflicts and issues when working on the last project.
Okay. So dependency injection is actually crucial for below applications. Not very crucial, but it's very good practice to do it, I would say. So how does it depend? The situation is usually it creates a single instance. It maintains the lifecycle of a lot of variables, a lot of fields like new model repositories, according to the scope of your activity and fragment. So usually I used to use it. And before that, I was using tags that actually did it incrementally. We have like good words, you know, a tagger. And so I used Dagger to create the entry point of all the modules. And I tell them what the scope of that new variable is, the scope of that variable to initialize, so that if you want some shared model of your model, then that I can make sure it should be implemented using Dagger, just by a single annotation, and all that can be easily done. And we can have a modern class where the modeling class can be used very efficiently, so that this should be like modeling activities, so that you don't need to create multiple assessors for us in written classes.
Under the video, custom for this thing. The Android application is a custom view for this, I'm missing a piece. Oh, I think I can't see anything which should not update the user because we are actually invalidating the view right here and in all getting the views. And if I'm using the, so I think we are not using the on trauma method or something like that. That might be one of the issues. Okay. And that's not able to find what they should.
So in this, I can see that it's using a URI. So URI is not empty. Oh, I, what I can see from here is that this is actually calling the user profile image function. And we have to make sure that this is always called from a suspended function or maybe from the lifecycle scope so that your update profile functions run to completion unless the lifecycle of the first screen is actually Yeah. So it will crash the application if your user tries to
For the optimized data binding, I reduced Okay. So, optimize data binding. So what I what I have actually done in that project is that I created a base class, a base fragment, and a base activity for every process, and what I did. So I passed a binder of the binding class where, like, if you're having a scribble and then you indicate in certain layout, it will create a binding class for each of those XML layouts. So in that case, what I used to do, I used a type where the new binding is the base step of the class. And every base function I have to use in the functions. And then they use those variables to infeed the views using those functions. And it will actually create a binding class in my subclass. Right? And those superclass which are actually included, which is actually your fragment or main classes. So, those classes can be actually used and then using their bindings to actually do some use this access where they were using binding dots. And then that will help me to truly use those variables without writing a lot of boilerplate code, like, what again and again on each of the fragments in each of the classes. So that's how I solved the problem. And then I used to clear all the bindings in the onDestory method. Yeah. That's pretty much it, that I used so that this can be used both in Java and Kotlin.
So let's talk about this Android. If we're talking about battery optimization, usually what happens when you run some apps in the background and you don't have battery optimization allowed. There are 2 ways to do it. First, you allow the app to optimize for better performance by going to the same place and telling the user not to allow optimization for this app. But the other way is to use work manager to upload data. If you have a drive file or real-time synchronization that updates every 15 minutes, you can use periodic work manager to update all those details into your servers using that data. Work manager allows you to configure your own optimizations. If your applications are low on battery, what matters is not allowing them to do it. They'll tell you to configure it yourself and tell the user that it's actually required. So you just give the permission to that. This is one way to do it. And other ways I'm not very familiar with.
To create a performance, scrollable dynamically loaded. Okay. So, one of the reasons to do it is so in the new use lazy column as lazy. If you're directly in trade, the user will actually recreate a preview when that comes to screen and it destroys every screen, every view that goes out of the screen when this call, but one way to do it is actually giving a cue to each of the items in the right list, scrollable. This is true, how it works. Lazy calling is a key callable function that you have to pass a key. This key can be stored into a bundle for each of the variables so that every time it creates, it does not recreate those views. It's actually, and actually use the same approach to create again. So, it's definitely not great to recreate all those views again. And so, if I talk more about the loaded images. So, what we can do is use Picasso or Glide libraries, and I use Cashier. I use local cache or specifically, I would say memory cache. So every time I load some image, it actively stores that image to my memory. And those memories can be used and utilized again if the same URL can be fetched from the server, so it's not fetched fresh from the server. Instead, it uses the local memory I've fed the data to. That's not there for the first time to fetch from this. So, that's how we can optimize our loaded images in a lazy call, in Jetpack Compose.