This document discusses different ways to save data in Android applications, including saving key-value sets using SharedPreferences, saving files using the File APIs, and saving structured data in an SQLite database. It provides an overview of SQLite, explaining that it is an open source database that requires little memory and supports data types and standard SQL features. It also gives guidance on using the android.database.sqlite package to define tables, create databases with SQLHelper, insert and read data, and update values in an SQLite database in Android apps.
2. Saving the Data
● 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.
3. Saving Key-Value Sets
● If you have a relatively small collection of
key-values that you'd like to save, you
should use the SharedPreferences APIs.
4. Saving Files
● Android uses a file system that's similar to
disk-based file systems on other platforms.
This lesson describes how to work with the
Android file system to read and write files
with the File APIs.
5. Saving Data in SQL Database
● Saving data to a database is ideal for
repeating or structured data, such as contact
information. This class assumes that you are
familiar with SQL databases in general and
helps you get started with SQLite databases
on Android. The APIs you'll need to use a
database on Android are available in the
android.database.sqlite package.
6. What is SQLite?
● SQLite is an Open Source Database
● supports standard relational database
features
● It requires only little memory at runtime
● SQLite supports the data types
7. SQLite in Android
● SQLite is available on every Android device
● SQLite database in android does not require
any database setup