Group Group Group Group Group Group Group Group Group

Room DB: Advanced Data Persistence | raywenderlich.com


#1

This tutorial introduces more advanced concepts for use with the Room persistence library, such as migration and indexing.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5686-room-db-advanced-data-persistence

#2

Should the AppDatabase be a singleton?


#3

@lgleason Can you please help with this when you get a chance? Thank you - much appreciated! :]


#4

Apologies Its actually a mistake of mine. I see it is a singleton through ListMasterApplication. Thanks anyway!


#5

That is correct, it should be a singleton. The reason for that is because spinning up the elements behind Room are expensive. While you could choose not to, you would expend a lot of CPU and memory resources un necessarily doing so which is why Google recommends following a singleton pattern.