Download presentation
Presentation is loading. Please wait.
Published byLaureen Farmer Modified over 9 years ago
5
App Package Folder App data Folders Local Roaming Temp Removable Storage (SD Card) Cloud Credential Locker B/ground Transfer Publishers Shared Folder Picker Provider apps
6
Roaming Folder Settings Other devices can access what you put in here Data roamed cross-device Limited to 100kb per application Held in OneDrive storage Local FolderSettings Store local data here for use by your application Can store data up to the limit of the storage on the device Retained if the application is updated Temp Folder Use for temporary storage No guarantee it will still be here next time your program runs Cleaned up in a low storage condition Windows.Security. Credentials PasswordVault Credentials Credential Locker Use for secure storage of PasswordCred- ential objects Data roamed cross-device Publisher Cache Folder Shared storage for apps from same publisher Declare in app manifest
8
using Windows.Data.Json;.. public string Stringify() { JsonArray jsonArray = new JsonArray(); foreach (School school in Education) { jsonArray.Add(school.ToJsonObject()); } JsonObject jsonObject = new JsonObject(); jsonObject["id"] = JsonValue.CreateStringValue(Id); // Treating a blank string as null if (String.IsNullOrEmpty(Phone)) jsonObject["phone"] = JsonValue.CreateNullValue(); else jsonObject["phone"] = JsonValue.CreateStringValue(Phone); jsonObject["name"] = JsonValue.CreateStringValue(Name); jsonObject["education"] = jsonArray; return jsonObject.Stringify(); }
9
using Windows.Data.Json;.. JsonObject jsonObject = JsonObject.Parse(jsonString); Id = jsonObject.GetNamedString("id", ""); IJsonValue phoneJsonValue = jsonObject.GetNamedValue("phone"); if (phoneJsonValue.ValueType == JsonValueType.Null) { Phone = null; } else { Phone = phoneJsonValue.GetString(); } Name = jsonObject.GetNamedString("name", "");
10
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; // Create a simple setting localSettings.Values["exampleSetting"] = "Hello Windows"; // Read data from a simple setting if (localSettings.ContainsKey("exampleSetting")) { // Access data in value string data = localSettings.Values[ "exampleSetting" ].ToString(); } // Delete a simple setting localSettings.Values.Remove("exampleSetting"); // Composite setting Windows.Storage.ApplicationDataCompositeValue composite = new Windows.Storage.ApplicationDataCompositeValue(); composite["intVal"] = 1; composite["strVal"] = "string"; localSettings.Values["exampleCompositeSetting"] = composite;
18
using (var conn = new SQLiteConnection("demo.db")) { Customer customer = null; using (var statement = conn.Prepare( "SELECT Id, Name FROM Customer WHERE Id = ?")) { statement.Bind(1, customerId); if (SQLiteResult.DONE == statement.Step()) { customer = new Customer() { Id = (long)statement[0], Name = (string)statement[1] }; } var db = new SQLite.SQLiteAsyncConnection(App.DBPath); var _customer = await (from c in db.Table () where c.Id == customerId select c).FirstOrDefaultAsync(); if (customer != null) { var Id = _customer.Id; var Name = _customer.Name; } …and others!
19
private void LoadDatabase() { // Set the path to the SQLite database var DBPath = Path.Combine( Windows.Storage.ApplicationData.Current.LocalFolder.Path, "customers.sqlite"); // Initialize the database if necessary using (var db = new SQLite.SQLiteConnection(DBPath, SQLite.SQLiteOpenFlags.ReadWrite | SQLite.SQLiteOpenFlags.Create)) { // Create the tables if they don't exist db.CreateTable (); } SQLite-NET
20
public class Customer { [PrimaryKey, AutoIncrement] public int Id { get; set; } public string Name { get; set; } public string City { get; set; } public string Contact { get; set; } } SQLite-NET
21
private void LoadDatabase() { // Specify database location var db = new SQLiteWinRT.Database(ApplicationData.Current.LocalFolder, "sqlitedemo.db"); try { // Open a connection to the SQLite database – creates it if it does not exist await db.OpenAsync(); string sql = @"CREATE TABLE IF NOT EXISTS Customer (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR( 140 ), City VARCHAR( 140 ), Contact VARCHAR( 140 ) );"; await db.ExecuteStatementAsync(sql); } catch (Exception ex) { var result = SQLiteWinRT.Database.GetSqliteErrorCode(ex.HResult); throw new ApplicationException("Database create failed with error " + result); } SQLite-WinRT
31
User is the center of the experience, not the device. Available on the right device at the right time Input model optimized for the experience. Enabling Mobile Experiences with Universal Apps The Experience you want on the device you want User
36
Client Conflict resolution Server Conflict resolution
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.