(1) Yes, it;' absolutely fine.... I am also using that
(2) You can do that like this:

    user_data_in_shared = mPrefs.getString("Your_Key", "NOT_EXIST");

    If you have already defined your value for the key "Your_key",
than it will return the value. If no value is set on key "Your_Key",
then it will simple return the defalut value (whatever you set as
second parameter. here "NOT_EXIST")


(3) Simply replace the value with null.

On Jul 6, 6:06 am, chinna Durai <[email protected]> wrote:
> Hi
> I am developing a game in Android and need to store very few data in a
> persistance storage. I have few questions over it
>
> My first question is
>             I am currently using SharedPreference instead of SQLLite as i
> have to deal with very less data. so i have chosen SharedPreferance over
> SQLLite. Is that ok??
> Second Question is
>             How to check if the Preference is alreadyExists? I could check
> if the Key is exists using the method SharedPreferences.containks(String
> key) but i could not see if there is any method to find if the preference
> with PreferenceName(Any  preference name to store our datas) is already
> exists???
> Third Question is
>             How to delete the entire Preference?
>
> --
> Thanks and Regards
> Chinnadurai M
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to