Note that there are some explanatory texts on larger screens.

plurals
  1. POWrite JSON object to Windows Phone Isolated Storage
    primarykey
    data
    text
    <p>I'm trying to save a <code>JSON</code> object that is returned from <code>Azure Mobile Services</code> to the Windows Phone <code>isolated storage</code>. I've started with the code below, but I'm not entirely sure how to actually write the file to Isolated Storage or what format to save it in (XML, TXT, etc.).</p> <pre><code> string offlineData = Path.Combine("WPTracker", "Offline"); string offlineDataFile = Path.Combine(offlineData, "phones.xml"); var store = IsolatedStorageFile.GetUserStoreForApplication(); //Query try { phoneList = await phoneTable .Where(PhoneItem =&gt; PhoneItem.Publish == true) .OrderBy(PhoneItem =&gt; PhoneItem.FullName) .ToListAsync(); } catch (MobileServiceInvalidOperationException f) { MessageBox.Show(f.Response.Content.ToString(), string.Format("{0} (HTTP {1})", f.Response.Content, f.Response.StatusCode), MessageBoxButton.OK); } //Write IsolatedStorageFileStream dataFile = null; dataFile = store.OpenFile(offlineDataFile, FileMode.Create); DataContractSerializer ser = new DataContractSerializer(typeof(IEnumerable&lt;Phones&gt;)); StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); JsonWriter jWriter = new JsonTextWriter(sw); ser.WriteObject(dataFile, phoneList); dataFile.Close(); </code></pre> <p>Any suggestions? :)</p> <h2>Edit</h2> <p>I decided to write the data to Isolated Storage using a JSON file, rather than XML. This was because my data from Azure Mobile Services is being sent in JSON. No need to convert it to XML. A link can be found below!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload