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

Android SDK
Could you help me understand more and more? Yep. So let's talk about my introduction. So I am Riaz Ahmed, and I have worked nearly 4 year 8 month of experience in Android development. Uh, currently I'm working, uh, in a company named SaverhillTech. We are of I'm working as a lead render developer where Oh, I manage all the applications in our system. And what's the application does is it's an e commerce application where you can buy the medicines from, from the distributors. So I'm managing the whole application right off, right off now and I am was the 1st developer to work on it and I started the app with Zoom so I can make it in the place it is right now. And prior to this, I was working with Navi Technologies who which is a Fintech application. Where I started working with member team from scratch and later I make it to the next stage for the development and make it live from pescrow with the team. The 3 months of work month of plan make it stable after that. And, yeah, that's pretty much it from the starting of the my career. And, uh, also with that, I also worked on an open source projects where I can take graphs and a boiler update API codes. Currently as a side project, I am also working on a navigation scheme for JETAC composers, which is working on Android. So I really keep on exploring new stuffs and all other things which comes to the marketing and Android world and other words too. Uh, 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, uh, so frame in the scenarios where I want some more layouts to be, uh, come in front of each other, maybe in the form of stock. So in that most of the times I use frame the audience to construct your customer. Most of the complex layout where it takes a lot of computation to align items according to the constraints from 1 view to the another view. So the pieces where frame layout is better Oh, where you have a stack of items. And at that point of time, I probably try to use stranger because That gives some more better performance because it does not have a very, uh, it does not have a very constrained layout where you have to be reliant other users, uh, come at the top of each other.
Um, I can manage different requests. Okay. Oh, so in Android, mostly what I try to use is the coroutines, uh, with With dispatches or tires, I mean, to make it there. So I try to use that thing, Um, with MBVM pattern. So I tried to use corrugates in your model, in every model scope So that, uh, you I can make different API calls. I verify one those to be, uh, hit Adily multiple, it has to be hit badly or, um, or maybe not valid and maybe in sequential manner. I, for definitely both of them, I, I will use coroutine with the special value. And then I will consume that in your model and emit that to a State views and then create shown to the UI. And coroutines help you to manage all your task, which is in the scope of your new model. So that if your model destroyed, you're all the tasks, which is already happening in your new model will also get destroyed at
Or do you ensure atomic transitions in local? Okay. So how I can make a common transition. So from this question, I can think of where I can make a single transaction signal point of time where then I can what I can do, uh, I can introduce add multiple queries into 1 transactions and using the room database. And I'll try to make sure that only single print single thread. I will use a single instance of that database variable. And I lose trade locks to lock all the queries. So only 1 execution can be executed at single point of time. So that Multiple threats should wait. If some other task is happening in that database for a right query. So, uh, so that, You can have an autumn atomic transactions in the local database.
Oh, would you know, mitigate your conflicts and get welcome in the last couple. So, um, so avoid this thing. Usually you, uh, what I used to do, I create a main branch where all the contributors will um, they could create a new branch out of it. And then, uh, what we usually do is um, we make changes into our code in our, uh, in our branch, which is created by ourselves. And then what we do at the end of the project, um, at the end of the completion of that feature, I tried to pull that code, which is the recent code from the server. And if there are changes, if get a more complex. I try to resolve those most conflicts during that time. I pull that into my code. Um, and if you have very big feature, what is basically good way to do it is maybe a good factor to it, to keep pulling your main branch um, every day or 2 so that you will get your updated code base. And, and at the end of the feature, you don't have to, um, uh, merge make a lot of changes, uh, decisions to which food to take in, which would not to take at the end of this. So if you keep on doing it, you will uh, Nord face a lot of merge conflicts and issues work with working with last spell project.
Okay. So dependency injection is actually crucial for below, uh, under applications. Not very crucial, but it's very good practice to do it, I would say. Uh, so how did, what does it depend? The situation is usually it creates a single instance. It it maintains the life cycle of lot of variables, lot of fields like new model depositories, according to the scopes of your, uh, activity and fragment. So usually I used to hit recently. And before to that, I was using tags that actually hit is incremental. We have like the, uh, good words, you know, tagger. And so I used dagger to, uh, create the entry point of all the modules. And I tell them what the scope of that new of the scope of that variables to we initialize so that if you want some shared your model of your model, then that I can make sure that it should should be implemented using DAGGER using just by single annotations and all that can be easily driven. And we can have a modern class where modeling class can be you used very efficiently so that this should be, uh, like modeling activities so that, uh, you can don't need to create multiple assessors for us in written classes.
In under the video custom for this thing. The Android applications is a custom view for this I'm missing piece. Oh, I think I cannot see anything which Should not update the user because we are actually invalidating the news right here and In the, in all getting the views. And if I using the, so I think we are not using on trauma method or something like that. That might be the one of the issues. Okay. And that's not able to find what they should.
Hello. 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 that This is actually calling the user profile image function. And we have to make sure that always this is this should be call it from, uh, uh, this should be called from a suspended function or maybe from, from a life cycle scope so that, Oh, your update profile functions should run these execution until, unless your life cycle of first screen is actually Yeah. So so it will crash the application if your user tries to,
For the optimized data binding and reduce Okay. So Optimize data binding. So what I what I have done actually in that project is that so I created a base class a base fragment and base activity in every process and what I did. So I pass a binder of binding class where like, if you're having 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 use it, uh, t type where new binding is the base step of the class. And every base function I have to You told us in the functions. And then they use those variables to infeed the views using that functions. And it will actually create a binding class in my a sup in my subclass. Right? And those super classes which are actually included, which is actually your your fragment on the main classes. So that classes can be actually I'm using and then using their bindings to actually do some, uh, use this access where they was using binding dots. And then that will help me to truly use those variables without writing a lot of boiler, like, what again and again on each of the fragments in each of the Thanks. So that's how I solve the problem. And then I used to clear all the, those bindings in the, in the, on this one method. Yeah. That's pretty much it that I used so that this can be used both in that you can use in both in Java and Kotlin.
Okay. So let's talk about, uh, this Android Android. So if we're talking about battery optimization, so, uh, usually what happens when you run some within the background and, uh, you don't have a battery optimization allowed. So there's a 2. There are 2 ways to do it is like, I, then you first allow, like you go to the same place and tell the user to, Oh, don't allow for better optimization for this app is the one way to do it, the ZV, but in the other way is You can use work manager to actually upload some data. If you have a drive file or maybe real time synchronization, Not exactly anytime, but you update in every 15 minutes or something. You can use periodic work manager to actually update all those details into your servers using that data And, uh, and work my dad allows you to configure all your back to the optimizations. If your applications are any low on battery, then what matters is not allowed to do it? Like not a lot of them get in there. They'll Tell you to configure by your own and tell the user that it's actually required. So that you just give the permission to that. This is the one of the way to do it. And other ways I'm not very expert that
The compose to create a performance, scrollable dynamically loaded. Okay. Okay. So, uh, so one of the reasons to do it is so in the new use lazy column as lazy, Uh, if you're directly in trade, the user will actually recreate a preview when that comes to screen and it, 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 item in the right list, list scrollable, this true, how it works And lazy calling is a key callable phone, uh, callback function that you have to pass a key. Uh, that 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 obvious to create again. So it's definitely not great. All those views again. And so If I talk more about the loaded images. So what we can do, you can use Picasso or glide libraries and what I do, I use cashier, Uh, local cache or, uh, Specifically, I would say memory cache. So every time I load some image is active stores that, uh, image to my memory. And those memory can be used and utilized Again, if the same URL can be fetched from the server, so it's not fresh from the server is actually. Use the local memory I fed the data. That's not there for the 1st time into active face from this. So, so that's how we can optimize our Loaded images in a Lazy call them is Jetpack Compose.