Although I will not pretend to carry the well-deserved air of
authority on such issues that Mark does, I will add one small point:
in general, just as you can use a screwdriver as a hammer in a pinch,
but it is not a good idea, so with any tool, it should be used for the
purpose it was designed for. Now in this case, even the very name of
the class 'Shared Preferences', tells us what it was designed for:
shared preferences. Using it for anything else should be expected to
be sub-optimal, even if you have been able to get away with it so far.

Likewise, similar to Mark's warning about it becoming an 'albatross',
in a future version, SharedPreferences might work as expected ONLY for
data that is truly preference data, and work well only if it is
shared. By giving it this name Google is making a commitment that it
will always work well for shared preferences. No such commitment is
made for using SharedPreferences for generic data persistence.

On Feb 24, 12:36 am, String <[email protected]> wrote:
> On Wednesday, February 23, 2011 11:30:53 PM UTC, Mark Murphy (a Commons Guy)
> wrote:
>
> So, it's mostly paranoia, with a side order of data model ick. For the> OP's 
> roster of three booleans, as with your "one-off data items", it's
> > probably OK.
>
> Thanks for sharing that insight, Mark. I think I see where your paranoia is
> heading, and I'll try to keep it in mind as I use SharedPrefs moving
> forward.
>
> We now return you to your originally scheduled topic... Jake, since it seems
> like your code works in 2.2 but not 1.6, are you familiar with the Service
> changes that occurred in 2.0? Not sure if there's anything to it which
> affects your code, but you can read more 
> here:http://android-developers.blogspot.com/2010/02/service-api-changes-st...
>
> String

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

Reply via email to