Once you've created your Open Helper and Data Source classes, you can start adding code to manage your database, including code to insert, update, and delete rows, and to read data from the database tables. This code should be placed in the data source class. Each database operation can be represented by a single public method so the methods can be called from anywhere in the app.
- [Instructor] Once you've created your open helper…and data source classes,…you can start adding code to the data source…to insert, update, and delete rows…and read data from the database tables.…I'll start with inserting data into the items table.…In the data source class I'll add a new method…that I'll name createItem and it'll return a reference…to a data item object.…It'll receive as its one and only argument…in the instance of the data item class…that I'll just name item.…It'll be public so it can be called…from anywhere in the application.…
And it returns an instance of the data item class…so I can then see anything that…might've changed in that object.…Now to insert data into the table,…you could execute an explicit SQL statement.…But then it would be up to you…to handle all sorts of special coding,…including escaping special characters,…using single quotes where you should be using double quotes,…and so on.…Instead you can use a set of convenience methods…that are a part of the SDK…for inserting, updating, and deleting data.…
- Modeling data in POJO classes
- Customizing a ListView item display
- Displaying data in a RecyclerView
- Creating a custom array adapter
- Managing shared preferences with Java
- Creating and importing JSON data files
- Accessing SQLite from the command line
- Retrieving data with SQLite queries
Skill Level Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m Intermediate
Android App Development: RESTful Web Serviceswith David Gassner2h 25m Intermediate
1. Display Static Data
2. Store Data in Shared Preferences
About shared preferences4m 41s
3. Store Data in Text Files
4. Manage Relational Data with SQLite
Next steps1m 43s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.