Confirmed users
975
edits
| Line 120: | Line 120: | ||
====Create the table and query & insert via BrowserProvider==== | ====Create the table and query & insert via BrowserProvider==== | ||
*Add your table name & schema as a new <tt>static</tt> class in <tt>BrowserContract</tt> | *Add your table name & schema as a new <tt>static</tt> class in <tt>BrowserContract</tt>. It will likely need the <tt>@RobocopTarget</tt> annotation to be accessible for testing | ||
*Increment the <tt>DATABASE_VERSION</tt> in <tt>BrowserDatabaseHelper</tt> and update the related bug # comment | *Increment the <tt>DATABASE_VERSION</tt> in <tt>BrowserDatabaseHelper</tt> and update the related bug # comment | ||
*Implement a create method to create your table | *Implement a create method to create your table | ||
| Line 128: | Line 128: | ||
*Add to the <tt>BrowserProvider.query</tt> method (pattern match!) by setting the projection map and table in the <tt>SQLiteQueryBuilder</tt> object. | *Add to the <tt>BrowserProvider.query</tt> method (pattern match!) by setting the projection map and table in the <tt>SQLiteQueryBuilder</tt> object. | ||
*Add to the <tt>BrowserProvider.insertInTransaction</tt> method (pattern match!) by calling out to your own method to insert into the DB | *Add to the <tt>BrowserProvider.insertInTransaction</tt> method (pattern match!) by calling out to your own method to insert into the DB | ||
====Test insertions via BrowserProvider==== | ====Test insertions via BrowserProvider==== | ||
*Add a <tt>TestInsert* extends TestCase</tt> class with a <tt>test</tt> method. Insert a value, query, and make sure you receive what you think you should! Pattern match other tests here. | *Add a <tt>TestInsert* extends TestCase</tt> class with a <tt>test</tt> method. Insert a value, query, and make sure you receive what you think you should! Pattern match other tests here. | ||