You are on page 1of 3

STORING LOCAL DATA

IN MOBILE APPLICATION
Some of the most common methods used for
storing the local data are:
• Shared preferences: this is a simple key-value store for small amount of data that need to persist across user
session. There are two context methods which is used for retrieving the shared preference objects .
o single preference :
CODE: sharedPreferences sharedPreferences = getPreference(MODE_PRIVATE);
o multiple preference :
CODE: sharedPreferences sharedPreferences = getsharedPreference(filename String, MODE_PRIVATE);

• SQLite: this is a relational data base management system that is commonly used for mobile applications.it
provides robust and flexible way for storing structured data and it supports advanced SQL operations such as
add data etc
• File storage : this allows you to save and retrieve files and folders on the devices file system. This
is useful for storing larger amount of data or files that need to be shared between different parts
of application.
• Key chain(IOS only): this is a secure storage mechanism provided by apple for storing sensitive
data like passwords, keys or certificates. Key chain provides a secure and convenient way to store
and retrieve data that needs to persist even when the device is locked.

You might also like