Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SQLite Best Practice Advice

This might be a bit cheeky but I would like some advice. I'm new to Android and have started to create my first app. I'm coming to the section where I need to create an SQLite DB with multiple tables and have been looking for best practices but have been unable to find my answer, this helped a little but not a lot What are the best practices for SQLite on Android?. I need about 6 tables in total.

  1. Should I use one "constants" class to keep all of my table names, field names and database name in?

  2. Should I create one "DBHelper" class to run all my SQL SELECT, UPDATE, DELETE in or create one per table?

  3. Any other advice around best practices around maintaining the data or any other classes I need?

  4. Bonus question :) If any one has any good examples they could point me towards as the Android documentation example is not in depth enough.

It's appreciated, I'm thinking about creating a blog with some simple examples for newbies to use as some of what I have read is a bit complex for small brains like mine.

like image 719
James Avatar asked Nov 03 '22 23:11

James


1 Answers

I found this which answers what I'm looking for. Not sure how I didn't find this before with all the searching! Thanks for all your help guys/girls!

Multiple Table SQLite DB Adapter(s) in Android?

like image 142
James Avatar answered Nov 11 '22 11:11

James