My Android app is reading and writing to a local SQLite database from several different activities and services. Pretty standard. But I am not happy that I have all the database data stored as constants, which I then use wherever I access the database. I recommend wrapping the database in ContentProvider. Sounds good. While I was reorganizing my code, I decided that I would ask:
- What are your best practices for storing database data locally in Android?
- Where and how do you store CREATE TABLE statements, column names, other SQL?
- Could you share a list of the classes you create and what is included in each (ContentProvider, DatabaseProvider, DatabaseHelper ...)?
- How do you coordinate the structure of your local Android database with the server database, accessible via the REST interface?
Yes, I understand that I am in a multi-year βcontext framework for binding objects to Android objectsβ? question. At the moment, I'm mostly interested in learning how you structure your Android applications with what is available in the standard SDK.
As always, thanks for the pointers!
android orm
Drew Dara-Abrams Nov 12 '09 at 22:33 2009-11-12 22:33
source share