Why onCreate() of RoomDatabase.Callback() is not called?

Photo by Tim Gouw on Unsplash

Room Persistence library is a part of android’s Jetpack components. It provides an abstraction layer over SQLite, which is also known as ORM(Object-relational Mapping). RoomDB has substantially increased developer productivity by removing tons of boilerplate code and need to manage SQLite directly. RoomDatabase.Callback() One of the many features Room provides is the callbacks fun onCreate() and fun onOpen(). These methods come in handy when we want to pre-populate the database. As simple as it might sound, it got tricky for

Continue Reading

Deep clones with Android Parcelable

Deep Clones There are many ways to create deep clones of an object, from Java’s Clone() function to Copy Constructors to custom implementations. All methods come with their own problems and a lot of boilerplate code. With Parcelable and advent of Kotlin, creating simple deep clones can be of no effort in your android project. Why Parcelable? Serialization is a technique to convert objects into a byte stream and Deserialization vice versa. In this process totally new objects are created

Continue Reading

Site Footer

Sliding Sidebar