Handling the SQLite database
Create a new class called DataManager
. We need an SQLiteDatabase
object and a whole bunch of final
string members for the table and column names.
All the code that we will add first to our DataManager
is straightforward, but it is worth pointing out that we will actually have two tables in this database. One called wis_table_photos
will have a column for each of the member variables of our Photo
class.
Another called wis_table_tags
will have just two columns, autoincrement _ID
and a tag
column.
The wis_table_photos
table will have a row of data for each and every photo the user takes. The tags
column will only have a row for each new/unique tag that the user enters. So, if the user has more than one photo with the "Barbados" ...
Get Android Programming for Beginners now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.