Once you've created your Database helper class, the next step in following the best practices for managing SQLite is to create another class called a data source. Its methods will be called by the rest of the app. You can create multiple data sources in an app. For example, you might create one data source for each table in a database or one data source for each set of tasks. How you architect that is up to you. In this simple app, we use a single data source class.
- [Instructor] Once you've created your database…helper class, the next step in following the best practices…for managing SQLight is to create another class…called a data source.…It will talk to the SQLight open helper, and it's methods…will then be called by the rest of the application.…You typically only have one SQLight open helper class…per database, but you can have as many data source classes…as you need.…For example, you might decide to create one data source…for each table in a database, or one data source…for each set of tasks.…
How you architect that is up to you.…In this simple app, I'll use a single data source class.…I'm working in a version of the project named data source…that already has a database open helper, and right now,…that class's methods are being called directly…from the main activity.…As the main activity opens, I'm getting a reference…to the helper class, and then from there, I'm getting…my database.…I'm going to hide all of that functionality inside…the data source, so that the main activity…
- 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 49m 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.