Hi
I am developing wp8 devotional app my questions are
1. How can i write a code to read the json/text file for each day's devotional locally
This is my code below
xaml
xaml.cs
protected override void OnNavigatedTo(NavigationEventArgs e)
{
AddDevotions();
int index = DateTime.Now.DayOfYear;
textblock.Text = devotions[index];
}
List
private void AddDevotions()
{
devotions.Add("4 Faith works miracles");
devotions.Add("5 Faith works miracles");
devotions.Add("6 Faith works miracles");
devotions.Add("7 Faith works miracles");
devotions.Add("8 Faith works miracles");
devotions.Add("9 Faith works miracles");
devotions.Add("10 Faith works miracles");
// add 366 days
}
Thank you in advance and reply soon

Michal HabalcikRank #902 · 2.3K reputationPosted Jan 15, 2015, 7:54 AM EST
C# Meets JSON: Lightweight Data-Interchange Format Explained
Bhushan GawaleRank #299 · 8.4K reputationPosted Jan 15, 2015, 9:34 PM EST
using (StreamReader r = new StreamReader("jsonfile"))
{
string json = r.ReadToEnd();
dynamic array = JsonConvert.DeserializeObject(json);
}
JsonConverter is the provider given by Nuget called as Json.net - you will need to install it in your project.
JOHN JOHNNNYRank #9,451 · 206 reputationPosted Jan 15, 2015, 10:56 PM EST
Thank you for the reply i appreciate, but what if i want to use it in my xaml.cs code above how am i to go about it.
I have not used json in project before am just starting out using it, kindly help
Thank you and reply soon