I am new to Android Platform. I have just started coding in Android.
In the concept of Data storage every book talks about Shared Prefereces.
My understanding od shared preference is that Its used for storing primitive key value pairs in the file. But What I don't understand is we can accomplish this even using a
bundle in Intent. WHy do we need a seperate concept of shared preferences.
Please correct me if my concepts are wrong.
Thanks and Regards,
Anil Deshpande wrote:If the preferences are being used for storing preferences, can't we do it in SQlite. Why preferecnes?
Ulf Dittmer wrote:Sure you can write code that does the same, but why do so if Android has something built-in that works?
Also, defining the preferences in the xml/preferences.xml file (instead of coding them up yourself) provides you with a nice preferences screen for very little work - very handy.
See http://www.androidguys.com/2008/09/29/whats-your-preference-part-one/, http://www.androidguys.com/2008/10/07/whats-your-preference-part-two/ and http://www.ibm.com/developerworks/xml/library/x-androidstorage/index.html for more information.