04 | Handling Files in Windows Store...

25
04 | Handling Files in Windows Store Apps Jerry Nixon | Microsoft Developer Evangelist Daren May | President & Co-founder, Crank211

Transcript of 04 | Handling Files in Windows Store...

Page 1: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

04 | Handling Files in Windows Store Apps

Jerry Nixon | Microsoft Developer Evangelist

Daren May | President & Co-founder, Crank211

Page 2: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013
Page 3: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Microsoft

Virtual

Academy

File Namespaces

Page 4: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

File Namespaces

• Windows.Storage.StorageFolder– Copy, Move, Rename, Delete

• Windows.Storage.StorageFile

• Copy, Move, Rename, Delete

• Windows.Storage.FileIO– Read, Write, Append methods

• Windows.Storage.Pickers– Folder, save/open File, Third Party

Capabilities and Strategies

• AppxManifest Capabilities

• App Storage (readonly)– “ms-appx://folder/file”

• Local Storage

• “ms-appdata://local/folder/file”

• “ms-appdata://roaming/folder/file”

• “ms-appdata://temp/folder/file”

File Namespaces

Page 5: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Read from Isolated Storage

Page 6: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Read Project Files

Page 7: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

With a file picker

Page 8: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Without a picker

Page 9: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Microsoft

Virtual

Academy

Process Lightcycle Lifecycle Management

Page 10: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013
Page 11: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013
Page 12: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

The User

Activates

Your App

splash screen

Page 13: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

The User

Activates

Your App

splash screen

Page 14: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Trigger Condition

InternetAvailable,

InternetNotAvailable,

SessionConnected,

SessionDisconnected,

UserNotPresent,

UserPresent

TimeTrigger*

PushNotificationTrigger*

SessionStart*

ControlChannelTrigger*(**)

ServicingComplete

SessionConnected

SessionDisconnected

SmsReceived

TimeZoneChange

UserAway/UserPresent,

LockScreenApplicationAdded/Removed

OnlineIdConnectedStateChangeInternetAvailable

InternetAvailable/InternetNotAvailable

NetworkNotificationChannelReset

NetworkStateChange

MaintenanceTrigger

PushNotificationTrigger** *requires lock permission

**can run in App (not BackgroundHost.exe)

Page 15: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Microsoft

Virtual

Academy

Activating Windows Store Apps

Page 16: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

ActivationPrimary

Tile

Secondary

Tile

Toast

Notification

Share

Target

Search

Contract

File

Activation

Protocol

Activation

Resume

Page 17: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

File Activation

• AppxManifest Declaration– MIME Type

– Extension (File Type)

– Tool Tip

– Display Name

– Logo

• Reserved Words like: – Com, Exe, Lnk

• Can have command arguments

• Search the Store

Activations

Page 18: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Protocol Activation

• AppxManifest Declaration– Protocol

– Display Name

– Logo

• Reserved Words like: – Ms-windows-store

– InternetShortcut

• Using URL://Data/Data/Data

• Search the Store

Activations

Page 19: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

Microsoft

Virtual

Academy

State Management Strategy

Page 20: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

1. Resume as the user left it

2. Start fresh if a long period of time has elapsed

3. Save data when suspending (5 seconds)– Save along the way

4. Release exclusive resources

State Management Guidelines

Page 21: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

• Comes with some Visual Studio templates

• RegisterFrame(frame), SaveAsync(), RestoreState()

Helpers :: Suspension manager

Page 22: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

• Orientation Events– Visual State Changes

• SaveState(suspension), LoadState(suspension)

Helpers :: Layout aware page

Page 23: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

State Management

Page 24: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013
Page 25: 04 | Handling Files in Windows Store Appsdownload.microsoft.com/download/A/5/8/A5841BF7-8999-40F9...File Handling Author Richard Harrison (Content Master Ltd) Created Date 5/2/2013

©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in

the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because

Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information

provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.