onebusaway-android icon indicating copy to clipboard operation
onebusaway-android copied to clipboard

Migrate from SQLite to Room for local storage

Open barbeau opened this issue 7 years ago • 3 comments

Summary:

Local storage in OBA Android is relatively complex and IMHO overly engineered, to the point where adding anything to the database becomes painful enough that you avoid doing it. Everything is exposed as a ContentProvider, but never used outside the OBA Android process. This overhead for maintaining/adding to persistent relational data storage makes it difficult for newcomers to the project to do anything related to the database.

I'd like to take a look at migrating our direct SQLite data storage system to Room, which is a library (part of the relatively new Android Architecture Components) that provides an abstraction over SQLite to manage persistent data via entity classes.

This looks like a good guide to get started, with an incremental approach: https://medium.com/google-developers/incrementally-migrate-from-sqlite-to-room-66c2f655b377

Steps to reproduce:

Try to add new fields or tables to the database

Expected behavior:

Make it straightforward to add new fields and tables to the database

Observed behavior:

It's relatively complex to add anything to the database

Device and Android version:

N/A

barbeau avatar Feb 09 '18 14:02 barbeau