Saturday, December 26, 2009

Re: [android-developers] Regarding SharedPreferences and my use-case.

On Fri, Dec 25, 2009 at 10:14 PM, Android Development <indodroid@gmail.com> wrote:
1. Are these preferences shared across android applications or only within the given application ? I saw a note in the documentation that read: 
Note: currently this class does not support use across multiple processes. This will be added later.

It is entirely per-application.  This comment is in reference to accessing it from multiple processes in your application, if you do that.

So i assume that this is not possible (across application interaction) but might be made possible in future releases ? 

Shared preferences are entirely by definition owned by the application, and will never be available to other applications.
 
2. Are there any best practices on what should be inserted in the SharedPreferences (if any) from a performance perspective (fast lookups) ?

As little as possible?  Not sure what else you are looking for here.  The less there is, the faster it will be.
 
3. Is the data stored in SharedPreferences secure ? Can I store passwords, license keys etc in it ?

They are stored on disk without encryption, but under your uid.  You can decide how comfortable you are with the things you are storing.
 
4. Shared Preferences data becomes persistent once committed. What is the persistence scope ? Is the data persistent across application re-start ? 

It is persistent until the application's persistent data is erased -- i.e., device wiped, or app and data uninstalled.

--
Dianne Hackborn
Android framework engineer
hackbod@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate