Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Major Difference between sharedpreference and internal file storage [duplicate]

I want to know which is better for storage purpose: Shared preferences or internal file storage. Which is faster? Is there any memory issue with anyone of them?

Thanks,

like image 322
Ram Avatar asked Jun 27 '12 08:06

Ram


1 Answers

  • SharedPreference: Store private primitive data in key-value pairs. (To store small entries/data)
  • Internal Storage: Store private data on the device memory. (To store large datasets)

More about Storage Options here: Storage Options

I have seen an issue about shared preference.

Issue: Whenever you face Force close/app crash while using SharedPreference, SharedPreference will be null. Here you can read more about it: Shared Preferences reset when the app is force closed or crashes

like image 132
Paresh Mayani Avatar answered Oct 31 '22 01:10

Paresh Mayani