Reputation: 865
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?Upvotes: 4
Views: 1412
Reputation: 1006944
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.
Upvotes: 5