Thursday, 15 January 2015

How to store user data in window phone 8 app? -


Please help me to store user data in Windows Phone 8 application? I have a plan to develop an application on Windows Phone 8, allowing the user to create an XML file to store his personal data. Question Window 8.1 is a way to store user data on the phone. After the search solution, I know that + can store separate storage data, but only small data for this app + Store data on the SD card is read-only. So, is there any other way to store data? Thanks and sorry about my English skills!

ApplicationData (LocalFolder on WP8 or LocalFolder and roaming folder on WP8.1) To be designed for Application settings are better for small pieces of data, but apps can save files of any size, which has a location in the LocalFolder for the phone.

Look for details on MSDN while Docs targets are available for the Silverlight app on Windows Runtime App, Application Data and Storage File API, Windows Phone 8 and above.

Additional uses:

  using System.Xml serialization; Use of windows Storage; Using System.IO;  

Code:

  Storagefolder localfolder = ApplicationData.Current.LocalFolder; Select StorageFile saveFile = Local Folder. KreffilesSync ("data.xml", CreationColisionOption.ReplaceExisting); (Var ras = save save.file.OpenAsync (using FileAccessMode.ReadWrite)) {Stream stream = ras.GetOutputStreamAt (0) .AsStreamForWrite (); XmlSerializer serializer = New XmlSerializer (type (list & lt; book & gt;)); Serializer.Serialize (stream, data); }  

If you need more structured data from XML then you can store the SQLite database in the local folder. If you need more space than the app needs to store on the device, you have to take it to the web service. A good place to do this is that you can call this service from a Windows Phone Silverlight app, but the wizard will generate universal apps.


No comments:

Post a Comment