Join David Gassner for an in-depth discussion in this video Using local data storage, part of Building a Note-Taking App for Android (2013).
The Android SDK offers multiple Options for storing and retrieving data…persistently on Android devices. The Options include: shared preferences;…arbitrary files in the format of your choice, including XML or JSON, and SQLite…based relational databases. All three of these options let you persist…data. That is, save the data to device data so…that it sticks around between application launches, or between the time you shutdown…a device and start it up again. The shared preferences API is the simplest…of these options. A shared preference is simply a data…object, and the form is a key value pair. The key is always a string, but the value…can be one of a number of data types, including integers, long integers,…doubles, Booleans, and strings. You can manage shared preferences data,…either completely programatically using Java, or through a special kind of…activity or screen called a preference activity.…
In this course, I'll only be working with shared preferences using the Java…programming language. You work with shared preferences using the…
Like its companions, this course will take you through building a complete mobile app from scratch; but this installment uses the Android SDK and Java to get the job done. Author David Gassner shows you how to install the SDK and the Android Developer Toolkit, create a project, save data on a device, build and control screen layouts, and create action bars and icons that control navigation.
These three related courses will use the same assets to develop the same app. (See Building a Note-Taking App for iOS and Building a Note-Taking App for Windows Phone 8 and Windows Store for more information.) Compare and contrast the different steps and discover the similarities and differences!
- Previewing the note-taking app
- Creating virtual devices for testing
- Unique concepts in Android
- Creating the Eclipse project
- Using local data storage
- Adding and retrieving data with the Shared Preferences API
- Creating screen designs
- Creating and editing notes
- Supporting older versions of Android with ActionBarSherlock