I want to make an apps that have timeline feature like twitter, instagram, or facebook. I have used them when there is no connectivity available, but app still show last feeds even when it's offline (I opened freshly open, not on the background).
My question is what is the best method to store last feeds on local? What's better using SQLite or PCL Storage? Or any other options?
Thanks in advance
Answers
Hi Nanda.
Caused by the fact, that adding numerous NuGet packages can get a bit messy, I do store all application data using System.IO. If it comes to parsing, I'd recommend using JSON format (see http://www.newtonsoft.com/json).
Inside your base project create an interface like:
Following, implement it inside your concrete projects (iOS, Android etc.) like:
Finally you can access it using a class like this
As I'd said earlier, I recommend using JSON format. Get in touch with Newtonsoft JSON package. Following, this class might get handy for you:
You can use it like this:
BTW you can also easily de-/serialize collections using Newtonsoft JSON:
Hi Nanda,
I prefer storing application data on the local filesystem using JSON formatted strings. Here is how I do solve this problem.
First of all, create those two classes inside your base project:
Caused by the fact, that you only have access to System.IO inside your native app projects, you will need to implement the interfaces on all your the native app projects. There are none differences on iOS or Android:
So, now you can save strings to the local filesystem. Following you can easily de-/serialize your objects using Newtonsoft JSON package:
public IEnumerable Locations { get; private set; }
Due to Xamarin Forum Server issues, my previous post got screwed up. Thus, sorry for the double post.
Editing URl should be https://forums.xamarin.com/post/editcomment/265631
It gives me a
Anyways, I don't see any chance to edit / delete my secondary created post. Maybe a mod might accomplish this for me please.