#5 Android Room Tutorial - Using Coroutines

preview_player
Показать описание
#AndroidRoomTutorial

In the last video we used AsyncTask to save our data into the database. And this process is a bit lengthy, so to minimize this effort we will implement Coroutines instead of AsyncTask in this video.

If you think this course is going to help you then please help me back by sharing this video to all your friends learning android application development.

And don't forget to follow us on
Рекомендации по теме
Комментарии
Автор

@1:59 to 2:59 code for gradle is as below

vishaln
Автор

For any confusion at 4:22 he implemented interface CoroutineScope. You can only extend one class, but implement many interfaces.

wardengrant
Автор

It's a very helpful video.
Here I want to use room db with my mvvm retrofit API call, how I can use it.
Please make a video on this.

manojdatt
Автор

It showing the lots error while using coroutines gradle build failed Not sure how to handle a insert method type..

ashwanibhardwaj
Автор

sir when you create BaseFragment you use main job in addNoteFragment you use insert in main thread i think it's not better if you add the function to make insert operation inside launch it is become better

أحمديونس-جض
Автор

Hello sir, how to apply this inside an adapter?
I have a list in recyclerview and upon clicking an item popmenu appears for saving. Upon clicking save app crashes.
All are done but I didn't get any idea on how to fire coroutine inside adapter.

sajantamang
Автор

I am working on other project and i have a question that, can I use BaseActivity instead of BaseFragment with abstract class BaseActivity:AppCompactActivity(), CoroutineScope{} ?

yashbrahmbhatt
Автор

async task is showing deprecated in AddNoteFragment

sawankumar
Автор

Why didn't you use thread instead of asynctask?

karanveer
Автор

hey I wrote a @transaction for deleting and adding a user that contains a delete query and an insert function, there seems to be some problem they work properly if I call it from my fragment but it returns an error when used as a transasction
sometimes a stackoverflow error sometimes a readonly error

pembatamang
Автор

How to update note if we are not using Navigation?

aswinskumar
Автор

hi
getting Compile time error when using coroutines with suspend Room Dao database

kaushalagarwal
Автор

How did we know that addnote method is running asynchronously??

karanveer
Автор

Bro the way you created context.Toast was great can you tell in Java as well as i am a java Guy. also i am really facing hard time to get Context in util/Helper class how to get Activity context in java

vrajendramandloi
Автор

on inheriting the base class, the home fragment and the add note fragment is throwing an error saying that these classes aren't abstract hence the base fragment can't be implemented!! help please

nikhilbhatnagar
Автор

Hi Belal can we follow this approach:
GlobalScope.launch {
saveNote(note)
}
suspend fun saveNote(note: Note){



Toast.makeText(activity, "Saved", Toast.LENGTH_SHORT).show()
}


}
after declaring functions Notes.Dao as suspend

raghavaggarwal