Application.Current.Properties vs Settings Plugin(user defaults/shared preferences)

I was trying to find some info on this in respect to should I use Application.Current.Properties to save user preference type data or am I better off using the plugin from James M. that uses the native storage options behind the scenes(shared preferences and userdefaults etc)? It seems like either would work. I was concerned that this would work in xamarin forms and not in normal xamarin project but I could not seem to find definite answer. Also I would guess an argument could be made that it is better to use the platform specific tech and with the plugin it is easy to use them but with one single interface. I think it seems folks prefer the settings plugin but I was hoping to get some feedback on which would be best.

Answers

  • EdwinKlesmanEdwinKlesman USMember ✭✭

    The way I see it, Using the settings plugin is nicer because:

    • it isn't dependant on Xamarin.Forms
    • You don't need to check if a property is already present since you can use GetValueOrDefault on the Settings plugin: if no value present, you can define which default value to return instead. This results in a little less code to write.
Sign In or Register to comment.