Damon
Damon

Reputation: 219

Is it possible to use Room Database in a Kotlin Library module?

I am working on an Android application with a lot of modules (based on features & layers) and wanted to convert my domain layers and data layers modules from Android modules to Kotlin/Java modules. But I am realising that room is an Android dependency and I need it for my models (domain layer) and DAOs (data layer). Is it possible to work with Room in a Kotlin module or do I have to make special models for room in my data layer and convert them every time to even make my domain layer modules Kotlin modules ?

Upvotes: 0

Views: 160

Answers (1)

Damon
Damon

Reputation: 219

For anyone wandering, I found the solution. You can use the Room Common dependency to access Room annotations outside of Android libraries.

androidx.room:room-common:2.6.1

Upvotes: 0

Related Questions