July 2015
Beginner to intermediate
600 pages
18h 59m
English
The first step in using your SQLiteDatabase is to write data to it. You will need to insert new rows into the crime table as well as update rows that are already there when Crimes are changed.
Writes and updates to databases are done with the assistance of a class called ContentValues. ContentValues is a key-value store class, like Java’s HashMap or the Bundles you have been using so far. However, unlike HashMap or Bundle it is specifically designed to store the kinds of data SQLite can hold.
You will be creating ContentValues instances from Crimes a few times in CrimeLab. Add a private method to take care of shuttling a Crime into a ContentValues. (Remember to use the same two-step ...
Read now
Unlock full access