Android – Shared Preferences

 

What is shared preferences and its methods? Shared preferences are different from preference API. It is used for storing small application data. This file consists of the key-value pairs. We use Sharedpreference API to store and retrieve data. Shared preferences are provided methods for reading and writing. It is managed by the SharedPreference framework. It can be also private or shared. There are two main methods: 1.getPreferences(): It is useful if only one shared preference is required in the activity. The default SharedPreference file is retrieved by using this method. 2.getSharedPreferences(): When multiple SharedPreference files are required which are to be identified by their respective names then this method is used.

– What are the different types of storage option?
1.Sharedpreference

2.Internal Storage

3.External Storage

4.SQLite Databases

5.Network Connection


Leave a Reply

Your email address will not be published. Required fields are marked *