Skip to content

Most visited

Recently visited


Saving Data

Dependencies and prerequisites

  • Android 1.6 (API Level 4) or higher
  • Familiarity with Map key-value collections
  • Familiarity with the Java file I/O API
  • Familiarity with SQL databases

You should also read

Most Android apps need to save data, even if only to save information about the app state during onPause() so the user's progress is not lost. Most non-trivial apps also need to save user settings, and some apps must manage large amounts of information in files and databases. This class introduces you to the principal data storage options in Android, including:


Saving Key-Value Sets
Learn to use a shared preferences file for storing small amounts of information in key-value pairs.
Saving Files
Learn to save a basic file, such as to store long sequences of data that are generally read in order.
Saving Data in SQL Databases
Learn to use a SQLite database to read and write structured data.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)