Posts

Showing posts with the label components

Android Architecture Components - Room - Kotlin

Image
Introduction: Google's Android Architecture components became stable now. It is nothing but a collection of libraries that ease our Android Development. Android Architecture Components: DataBinding Navigation Paging Library WorkManager LiveData & ViewModel Room Persistence Library Let's see about Room in this post.  Room is a new way to create a database in your Android Apps.  SQLite vs Room: The following are some of the advantages of Room over SQLite. (a) In SQLite, there is no compile-time verification of SQL queries, whereas Room verifies it. (b) We need to write lots of boilerplate codes to convert SQL queries to Java Objects. (c) We need to update the affected SQL queries manually, while the schema changes in SQLite. Whereas, Room will take care of it automatically. Room Architecure and Components: Three components are there in Room: (1) Database is a holder class that uses annotation to define the list of e