Presentation is loading. Please wait.

Presentation is loading. Please wait.

App Package Folder App data Folders Local Roaming Temp Removable Storage (SD Card) Cloud Credential Locker B/ground Transfer Publishers Shared Folder.

Similar presentations


Presentation on theme: "App Package Folder App data Folders Local Roaming Temp Removable Storage (SD Card) Cloud Credential Locker B/ground Transfer Publishers Shared Folder."— Presentation transcript:

1

2

3

4

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

7

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;

11

12

13

14

15

16

17

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

22

23

24

25

26

27

28

29

30

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

32

33

34

35

36 Client Conflict resolution Server Conflict resolution

37

38

39

40


Download ppt "App Package Folder App data Folders Local Roaming Temp Removable Storage (SD Card) Cloud Credential Locker B/ground Transfer Publishers Shared Folder."

Similar presentations


Ads by Google