OpenTracks icon indicating copy to clipboard operation
OpenTracks copied to clipboard

Use ORM instead of SQLite SQL

Open dennisguse opened this issue 2 years ago • 3 comments

We have quite a lot of code to manage three tables in a SQLite database. One option would be to use an ORM like https://developer.android.com/jetpack/androidx/releases/room

Moreover, all DB interaction is done via ContentProvider. This complicates the situation even further while it has the advantage that all data can be exposed to other applications.

Plan:

  • [ ] OpenTracks accesses SQLite DB directly (without CustomContentProvider)
  • [ ] Trim down CustomContentProvider to only provide data for Dashboard API (e.g., for OSMDashboard)
  • [ ] Check if ORM/Room helps to get rid of the large amount of data handling code

dennisguse avatar Jan 15 '24 22:01 dennisguse

I'd suggest also consider using JOOQ rather than an ORM.

ericjs avatar Mar 14 '25 21:03 ericjs

JOOQ is not an Androidx library and OpenTracks only Android standard libraries.

dennisguse avatar Mar 14 '25 21:03 dennisguse

Ok, sorry, I saw that you used Java code. I'm not familiar with the limitations of Java on Android.

ericjs avatar Mar 14 '25 21:03 ericjs