So what would you recommend as a way to persist a number of primitives
such as integers and booleans?  I agree that this is not a preference
but it is data that needs to be persisted and shared across activities
and services within the app.

>>>>> "IV" == Indicator Veritatis <[email protected]> writes:

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

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

   IV> 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

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

-- 
Jake Colman -- Android Tinkerer

-- 
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