I have a simple Xamarin Forms app. I've now got a simple POCO object (eg. User
instance or an list of the most recent tweets or orders or whatever).
How can I store this object locally to the device? Lets imagine I serialize it as JSON.
Also, how secure is this data? Is it part of Keychains, etc? Auto backed up?
cheers!
Please use
Xamarin.Essentials
The Preferences class helps to store application preferences in a key/value store.
To save a value:
To get a value:
Another option is xamarin forms settings plugin https://github.com/jamesmontemagno/SettingsPlugin. If u need store e.g. user instance, just serialize it to json when storing and deserialize it when reading.
Uses the native settings management
Windows RT / UWP: ApplicationDataContainer
You have a couple options.
I think you'll have to investigate and find out which route serves your needs best.
As far as security, that depends on where you put your data on each device. Android stores app data in a secure app folder by default (not all that secure if you're rooted). iOS has several different folders for data storage based on different needs. Read more here: iOS Data Storage