This is an API sample to showcase how to use Room, with Kotlin coroutines.
This sample app shows a list of words stored using Room database. The user can add new words or delete all in one operation.
The database is created using Room and has one entity: a Word
. Room generates the corresponding SQLite table at
runtime.
Queries are executed in the WordDao
class. The word retrieval is done via a LiveData
object.
Every time the user data is updated, the LiveData object will emit automatically, allowing to update the UI
based on the latest data.
The app has a Word Activity that displays the data. The Activity works with a ViewModel to do the following:
- subscribe to the emissions of the words and updates the UI every time there is a new word emitted
- notify the ViewModel when a new word has been added
- Koin Dependency injection framework
- Calligraphy Custom fonts