Hy,
I have been reading about content providers, Loaders and loaderManagers for whole week now and sadly I must admit, I'm no closer to working solution. And also, I think integrating full blown loadermanager-cursorLoader system would be perhaps an overkill for my needs. So if any of you could assess if this is true (or just excuse from my side :)), maybe direct me in right direction or even provide working example/implementation steps for my specific case, that would be great!
Background:
- I need to assure minimum compatibility up to API 10. App uses complex pre-populated SQLite backend with more than 30 tables in different relations to each other. And I load it by extending SQLiteAssetHelper class (not default SQLiteOpenHelper).
- BUT, interaction between user and database is almost exclusively on level of reading and displaying data, with very few (and far between) examples of some creates/updates/deletes (for, let's say some notes), so no need for synchronous and locking RDB. Most of the time user just selects button/listview position which should re-query RDB and update views accordingly.
- I also do not need to provide data (and don't wish to) to other apps. So, I guess, no explicit need for content provider (although I am aware I could forbid sharing of content provider in AndroidManifest).
So my questions are:
- Taking in to account background I provided, what would be right approach for minimum working solution that would enable querying RDB based on variable provided by button/list position that was pressed by user, and then displaying results of that query in new view/updating current view.
- Silly one, but it seems like I can't find definitive answer to this: Per developer guidelines, each table should provide primary key column named "_ID" for cursors to work. Here is the sillines -> What does that mean, exactly? I found guides that suggested naming them lowercase, like "_id", some tutorials used columns named "id", or "ID" and some even named them "columNameId"... Is it possible to name primary key column like: "columnname_id"? Or for my specific case, my primary key columns are named "ID_column_name", should I rename them all and make appropriate changes to my database? If there is no possible way that names stay the same, which is the most supported naming I can/must choose (ID, id, _id, _ID, ...)?
Thank you all!