-1

I am using SharedPrefrences in App to manage login session of user.

For that, I have used MODE_PRIVATE as an argument while initializing instance of SharedPrefrence as below :

SharedPrefrence myPref=getSharedPrefrences("MY_PREF",MODE_PRIVATE);

Now, I have read about different MODES used in SharedPrefrences like MODE_PRIVATE, MODE_APPEND, WORLD_READABLE etc..

But, I not get the things clearly. I have used MODE_APPEND in place of MODE_PRIVATE. Getting Same results.

What is the differences and conditions to use them?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Mashuk Khan
  • 67
  • 11
  • 2
    Possible duplicate of [Android SharedPreferences with MODE\_PRIVATE,MODE\_WORLD\_READABLE,MODE\_WORLD\_WRITABLE](https://stackoverflow.com/questions/13153231/android-sharedpreferences-with-mode-private-mode-world-readable-mode-world-writa) – MRX Sep 01 '17 at 07:00
  • I want to also know about MODE_APPEND. Its not explained there.. – Mashuk Khan Sep 01 '17 at 10:54

1 Answers1

0

MODE_APPEND

This will append the new preferences with the already existing preferences.

MODE_PRIVATE

In this mode, the file can only be accessed using the calling application, means the app.

Animesh Patra
  • 852
  • 8
  • 14