Join David Gassner for an in-depth discussion in this video Defining shared preferences with an activity, part of Android SDK: Local Data Storage.
In a previous video, I described how to set user preferences using Java code.…Now, I'll show you how to create a PreferenceActivity, a user interface…that lets the user type in values and save those values to persistent…storage automatically.…I'll be using a version of my project called Preference Activity that still…has the buttons to set and show preferences but now no longer has an EditText control.…I'll be handling user input through my new activity.…I'll start by creating a new layout.…
In the menu, I'll select File > New > Android XML file.…I'll set the Resource Type to Preference, and then I'll give the file a name of settings.…The .xml extension will be added automatically, and the new file will be saved…into an XML subfolder underneath my Resources Area.…I'll click Next, and I'll accept all the defaults here and click Finish.…That creates my new XML file.…The file might open to this view--the XML view--or might open to the Structure view.…
I'm going to start in the Structure view and add elements and categories here.…
- Exploring local data storage options
- Creating an Android virtual device
- Starting a new project
- Defining preferences with Java and activities
- Creating and reading JSON and XML data files
- Creating a new SQLite database
- Inserting and retrieving data in the database
Skill Level Intermediate
1. Getting Started
2. Using Application Preferences
3. Using Internal and External File Storage
4. Working with SQLite Databases
5. Managing and Displaying SQLite Data
Improving the data display9m 29s
- 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.