I recently saw the new feature announced on Google I/O Room Persistence Library to work with Sqlite databases on Android. I have been looking to the official documentation and I don't find which dependencies I should import to my gradle file on my Android project. Someone can give me a hand?
The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite. In particular, Room provides the following benefits: Compile-time verification of SQL queries.
Is Android Room an ORM? Room isn't an ORM; instead, it is a whole library that allows us to create and manipulate SQLite databases more easily. By using annotations, we can define our databases, tables, and operations.
Room Database is a part of the Android Architecture components which provides an abstraction layer over SQLite which allows for more robust database access while still providing the full power of SQLite. Room is a persistence library, part of the Android Jetpack.
It's possible to find the dependencies on the example codelab for the new architecture components.
Root :
allprojects { repositories { jcenter() maven { url "https://maven.google.com" } }
For Room:
implementation 'android.arch.persistence.room:runtime:1.0.0-alpha1' annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha1'
For Lifecycle dependencies:
implementation 'android.arch.lifecycle:extensions:1.0.0-alpha1' annotationProcessor 'android.arch.lifecycle:compiler:1.0.0-alpha1'
Adding Rxjava2 objects as result for our queries:
implementation 'android.arch.persistence.room:rxjava2:1.0.0-alpha1'
Test migrations:
testImplementation'android.arch.persistence.room:testing:1.0.0-alpha1'
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