storage - How can I save some user data locally on my Xamarin Forms app? -
i have simple xamarin forms app. i've got simple poco object (eg. user
instance or list of recent tweets or orders or whatever).
how can store object locally device? lets imagine serialize json.
also, how secure data? part of keychains, etc? auto backed up?
cheers!
you have couple options.
- sqlite. option cross-platform , works if have lot of data. added bonus of transaction support , async support well. edit: in past suggested using sqlite.net-pcl. due issues involving android 7.0 support (and apparent sunsetting of support) recommend making use of project forked from: sqlite-net
- local storage. there's great nuget supports cross-platform storage. more information see pclstorage
- there's application.current.properties implemented in xamarin.forms allow simple key-value pairs of data.
i think you'll have investigate , find out route serves needs best.
as far security, depends on put data on each device. android stores app data in secure app folder default (not secure if you're rooted). ios has several different folders data storage based on different needs. read more here: ios data storage
Comments
Post a Comment