1 / 22

RADNUG

RADNUG. AUGUST 28 2012. ANNOUNCEMENTS. Half-day coding event? Get the word out Mention RADNUG to coworkers and friends Put up a flyer Tweet about it (@RADNUG). Upcoming Code Camps. Richmond Code Camp ~40 sessions Saturday, October 6 th University of Richmond

phuc
Download Presentation

RADNUG

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RADNUG AUGUST 28 2012

  2. ANNOUNCEMENTS • Half-day coding event? • Get the word out • Mention RADNUG to coworkers and friends • Put up a flyer • Tweet about it (@RADNUG)

  3. Upcoming Code Camps • Richmond Code Camp • ~40 sessions • Saturday, October 6th • University of Richmond • Signup & Info: http://richmondcodecamp.org/ • NoVA Code Camp • Saturday, October 27th • Reston, VA @ Microsoft TC • Signup & Info: http://novacodecamp.org/

  4. Upcoming Meetings • September 25 • Joel Cochran, knockout.js and single page applications • October 23 • Kevin Griffin, topic TBD • November 27 • Stuart Leitch, topic TBD • No meeting in December, will resume in January

  5. Windows 8 Developer Resources • Microsoft Dev Center • http://msdn.microsoft.com/en-us/windows/apps • App Developer’s Blog • http://blogs.msdn.com/b/windowsappdev/ • Generation App Site • http://www.generationapp.com/W8appsin30.aspx

  6. Windows 8 Development Lifecycle & State, App Contracts

  7. Without Lifecycle/State Management • Demo: HelloWorld (what else?)

  8. Lifecycle & State

  9. Suspension and Termination • App can be suspended • When user switches away from it • Windows enters low power state • Suspended apps are in memory • Quickly switch and resume • Windows can terminate your suspended app at any time • You’ve got 10 seconds to save things • Windows notifies your application about suspension but not termination, so you’ve got to handle things and assume termination

  10. SuspensionManager • Helper class to simplify the lifecycle management for your application • Saves & Restores the navigation state of the Frame that hosts app pages • Example application is single paged so it isn’t really important • Gives each page the chance to save & restore its state • Serializes the state data & writes it to XML in the app’s local storage

  11. Application Data and Session Data • App data is cross-session • Session data is localized to the current session • How and when you save these two categories of data differs

  12. To use the SuspensionManager • Register the main app Frame when it is created • App.xaml.cs, OnLaunched method • Handle the saving of App Data as needed • e.g., TextChanged event • Handle the saving of Session Data when suspending • OnSuspending handler • Handle the loading of App Data • OnLaunched event • Handle the loading of Session Data if it exists

  13. Simple Example of Lifecycle & State Saving • Demo: LifecycleAndState

  14. Simulating Suspending, Terminating & Restoring an Application in Visual Studio • Suspend & Terminate • F5 to run in debug • Enter some data & click • Alt+Tab to VS • Suspend and shutdown • Termination • F5 to run in debug • Enter some data & click • Alt+Tab • Debug>Stop Debuging • Demo This

  15. Application Contracts

  16. What are App Contracts • Optional functionality which enables cross-application interactions. • Share • Search • Play To • File Picker

  17. Defined Interface between Processes Process2 Process1 Local context Local context Web context Web context Contracts AppData AppData Local Local Temp Temp Roaming Roaming Brokers Direct APIs OS User Data Devices Communications Handlers Tiles Cryptography …

  18. Sharing Source and Target • Demo: MyShareSourceExample & ShareTarget

  19. How to Define a Share Source • DataTransferManager, initialized in OnNavigatedTo() • DataRequested handler • Set the request data in the handler • Look at MyShareSourceExample

  20. How to Define a Share Target • package.appxmanifest • Declare your application as a Share Target • Supported Declarations -> Choose Share Target from Available Declarations • Click Add button • What file types does your application support? • Supported File Types ->Add New • .docx, .txt, .whatever  Include the dot! • What data formats does your application support? • Data Formats->Add New • “Text”, “HTML”, “Bitmap”

  21. Example: Contoso Recipe Application

  22. App Contract Considerations for RADNUG • RADNUG metro application can take advantage of app contracts

More Related