The simplest sort of data that you can store persistently on disk in an Android app is called a preference. Preference values are saved in unencrypted XML files in what’s known to developers as internal storage. This storage area is invisible to the user; unless the device is rooted, the user can’t see files in internal storage with a file manager app. You can keep all of an app’s shared preferences in a single file, or you can break them up into multiple files. The choice is yours.
- [Instructor] The simplest sort of data…that you can store persistently in an Android app…is called a shared preference.…Shared preference values are stored…in un-encrypted XML files in what's known…to developers as internal storage.…This storage is invisible to the user.…Unless the Android device is rooted,…the user can't see files in internal storage…with the File Manager app.…You can store all of an app's shared preferences…in a single file, or you can break them up…into multiple files, the choice is yours.…
Each set of preferences is known as either…the default set or a named set,…and I'll show you how to use both types of sets…later on in this chapter.…There are a couple of different ways…to create preferences in an app,…but regardless of how you do it,…each preference is a simple key value pair.…The keys are always strings, but the values…can have one of a number of different types,…including strings, integers, long integers,…floating values, and booleans.…
It's also possible to create a single preference value…
- 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.