I have a major concern. I just read about the android ViewModel
as a better alternative to surviving orientation changes in android and a way to reduce boilerplate codes. I have an existing project done with SQLite
and LoaderManager
and would like to migrate from the use of Loaders
to ViewModel
. However all the tutorials and docs I find online always uses ViewModel
with Room
Library.
I cant afford to start learning Room and my project will be very difficult to refactor in order to support Room.
Hence goes my question:
SQLite
with ViewModel
?ViewModel
designed to work only with Room
database?Can I use raw SQLite with ViewModel?
Yes, as ViewModel
has nothing to do with any particular source of data.
Was ViewModel designed to work only with Room database?
No. They are completely independent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With