Credential Locker Publishers Shared Folder Cloud Picker Provider
Credential Locker Publishers Shared Folder Cloud Picker Provider apps B/ground Transfer Temp Roaming App data Local App data Folders App Package Folder Removable Storage (SD Card)
Windows. Security. Credentials Local Roaming Folder Settings • Other devices can access what you put in here • Data roamed cross-device • Limited to 100 kb per application • Held in One. Drive storage Folder Settings • 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 Publisher Cache Folder • Shared storage for apps from same publisher • Declare in app manifest Password. Vault Credentials • Credential Locker • Use for secure storage of Password. Credential objects • Data roamed cross-device
using Windows. Data. Json; . . public string Stringify() { Json. Array json. Array = new Json. Array(); foreach (School school in Education) { json. Array. Add(school. To. Json. Object()); } Json. Object json. Object = new Json. Object(); json. Object["id"] = Json. Value. Create. String. Value(Id); // Treating a blank string as null if (String. Is. Null. Or. Empty(Phone)) json. Object["phone"] = Json. Value. Create. Null. Value(); else json. Object["phone"] = Json. Value. Create. String. Value(Phone); json. Object["name"] = Json. Value. Create. String. Value(Name); json. Object["education"] = json. Array; return json. Object. Stringify(); }
using Windows. Data. Json; . . Json. Object json. Object = Json. Object. Parse(json. String); Id = json. Object. Get. Named. String("id", ""); IJson. Value phone. Json. Value = json. Object. Get. Named. Value("phone"); if (phone. Json. Value. Type == Json. Value. Type. Null) { Phone = null; } else { Phone = phone. Json. Value. Get. String(); } Name = json. Object. Get. Named. String("name", "");
Windows. Storage. Application. Data. Container local. Settings = Windows. Storage. Application. Data. Current. Local. Settings; // Create a simple setting local. Settings. Values["example. Setting"] = "Hello Windows"; // Read data from a simple setting if (local. Settings. Contains. Key("example. Setting")) { // Access data in value string data = local. Settings. Values[ "example. Setting" ]. To. String(); } // Delete a simple setting local. Settings. Values. Remove("example. Setting"); // Composite setting Windows. Storage. Application. Data. Composite. Value composite = new Windows. Storage. Application. Data. Composite. Value(); composite["int. Val"] = 1; composite["str. Val"] = "string"; local. Settings. Values["example. Composite. Setting"] = composite;
Roaming data enables an application to synchronise data and/or settings across different devices Roaming. Folder and Roaming. Settings are synced through the cloud
var db = new SQLite. Async. Connection(App. DBPath); var _customer = await (from c in db. Table<Customer>() where c. Id == customer. Id select c). First. Or. Default. Async(); if (customer != null) { var Id = _customer. Id; var Name = _customer. Name; } using (var conn = new SQLite. Connection("demo. db")) { Customer customer = null; using (var statement = conn. Prepare( "SELECT Id, Name FROM Customer WHERE Id = ? ")) { statement. Bind(1, customer. Id); if (SQLite. Result. DONE == statement. Step()) { customer = new Customer() { Id = (long)statement[0], Name = (string)statement[1] }; } } } …and others!
SQLite-NET private void Load. Database() { // Set the path to the SQLite database var DBPath = Path. Combine( Windows. Storage. Application. Data. Current. Local. Folder. Path, "customers. sqlite"); // Initialize the database if necessary using (var db = new SQLite. Connection(DBPath, SQLite. Open. Flags. Read. Write | SQLite. Open. Flags. Create)) { // Create the tables if they don't exist db. Create. Table<Customer>(); db. Create. Table<Project>(); }
SQLite-NET public class Customer { [Primary. Key, Auto. Increment] public int Id { get; set; } public string Name { get; set; } public string City { get; set; } public string Contact { get; set; } }
SQLite-Win. RT private void Load. Database() { // Specify database location var db = new SQLite. Win. RT. Database(Application. Data. Current. Local. Folder, "sqlitedemo. db"); try { // Open a connection to the SQLite database – creates it if it does not exist await db. Open. Async(); string sql = @"CREATE TABLE IF NOT EXISTS Customer (Id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR( 140 ), City VARCHAR( 140 ), Contact VARCHAR( 140 ) ); "; await db. Execute. Statement. Async(sql); } catch (Exception ex) { var result = SQLite. Win. RT. Database. Get. Sqlite. Error. Code(ex. HResult); throw new Application. Exception("Database create failed with error " + result); } }
1. 2.
§ https: //channel 9. msdn. com/Series/A-Developers. Guide-to-Windows-10/10
The Experience you want on the device you want 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. User Enabling Mobile Experiences with Universal Apps
Client Conflict resolution Server Conflict resolution
- Slides: 39