Learn how to access and manipulate files on local and removable drives, how to roam settings between devices and how to store data in the cloud.
To learn more about Windows 8 data storage visit http://lunarfrog.com/blog/category/file-system/
2. Windows Runtime
Desktop applications Windows Store apps
WPF SL HTML DX HTML5 XAML DirectX
C# / VB JavaScript JavaScript C# / VB
C++ C++
.NET IE IE Engine .NET
Windows Runtime Services and APIs
Storage Sensors Media
Win32 APIs
Metadata UI XAML Controls
Network …
3. Windows Runtime
Sandboxed environment
• No direct communications between the apps
• Brokered access to system resources
File system direct access
• Local data
• Temporary data
• Installation folder
• Downloads
4. .NET Framework
Windows Store profile
• Subset of client profile .NET framework
• No File / FileInfo
• No Directory / DirectoryInfo
5. File system entities
File system items
• StorageFolder
• StorageFile
Helper classes
• PathIO
• FileIO
6. Demo: Local data
• Windows.Storage.ApplicationData
• Folders
• Settings
• StorageFolder, StorageFile
• PathIO, FileIO
• ms-appx:///, ms-appdata:///local|temp|roaming/
13. Files and settings
Application data
• Local/Roaming folder and settings
User data
• Libraries
Other folders and files
• Pickers
14. Databases
Current state
• No System.Data
Options
• SQLite
• ESENT
• Azure Mobile Servces
• Web/Cloud services of you choice
15. SQLite
• SQLite for Windows Runtime extension
• Managed SQLlite library, e.g. sqlite-net
using (var db = new SQLite.SQLiteConnection(dbPath))
{
db.CreateTable<City>();
db.RunInTransaction(() =>
{
db.Insert(new City() { Name = "Toronto" });
});
}
16. ESENT
Extensible Storage Engine
• Indexed sequential access data storage
• Used by Windows 8 Zune Music and Video
Managed wrapper
• ManagedEsent.codeplex.com
Overview
http://lunarfrog.com/blog/2012/09/23/extensible-storage-engine/
18. App-to-app data sharing
Share Contract
• Text
• HTML
• URI
• Bitmap
• File
• Custom data
• schema.org formats
• https://github.com/AndreiMarukovich/Transhipment
19. Data
Local storages
• XML, SQLite, ESENT, etc.
Cloud storages
• SkyDrive, Azure Mobile Services, custom
services