making your windows store app more reliable

31

Upload: varana

Post on 22-Feb-2016

221 views

Category:

Documents


0 download

DESCRIPTION

Making your Windows Store app more reliable. Harry Pierson Senior Program Manager, Runtime Experience Team @ devhawk 3-136. Good ratings and reviews are critical to the success of your Windows Store app. Unreliability is the top reason why users give apps bad ratings and reviews. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Making your Windows Store  app  more reliable
Page 2: Making your Windows Store  app  more reliable

Making your Windows Store app more reliableHarry PiersonSenior Program Manager, Runtime Experience Team@devhawk3-136

Page 3: Making your Windows Store  app  more reliable

Good ratings and reviews are critical to the success of your Windows Store app.

Page 4: Making your Windows Store  app  more reliable

Unreliability is the top reason why users give apps bad ratings and reviews.

Freeze

s

Crashe

s

Slow Resp

onsiv

eness

Heavy

Battery

Usage

Too M

any A

ds0

1020304050607080

Source: Apigee 2012 Mobile App Review Survey

Page 5: Making your Windows Store  app  more reliable

Bad things happen to good apps.

Reliability is a continuing process.

Page 6: Making your Windows Store  app  more reliable

Monitor and regularly improve the quality of your app in order to avoid the #1 cause of bad reviews.

Page 7: Making your Windows Store  app  more reliable

Quality telemetry and the Windows Dev CenterAdding logging to your appNew Windows Runtime error and logging APIsEnd-to-end demo

Agenda

Page 8: Making your Windows Store  app  more reliable

Regularly review your app’s quality telemetry on the Windows Dev Center.

Page 9: Making your Windows Store  app  more reliable

Microsoft automatically collects analytics and telemetry data about your Windows Store app.

Page 10: Making your Windows Store  app  more reliable
Page 11: Making your Windows Store  app  more reliable
Page 12: Making your Windows Store  app  more reliable
Page 13: Making your Windows Store  app  more reliable
Page 14: Making your Windows Store  app  more reliable

Error reports are not as useful as you might think.

Page 15: Making your Windows Store  app  more reliable

Take advantage of the new logging and error APIs to keep track of what is happening inside your application.

Page 16: Making your Windows Store  app  more reliable

Logs can provide temporal context needed to diagnose issues that occur on customers’ machines.Windows 8.1 includes a new logging API that’s very simple to use.

Page 17: Making your Windows Store  app  more reliable

Circular Memory Buffer

Keep a running log of recent events.

Save and send that log when an error is detected.

Logging to memory

Logging SessionLogging

Channel

Logging Channel

Logging Channel

Logging Channel

Error

Log File

Your Backen

dSaveToDiskAsync

Background Uploader

Page 18: Making your Windows Store  app  more reliable

LoggingChannel examplevar channel = new LoggingChannel ("ChannelName");channel.LoggingEnabled += (sender, args) => { _isLoggingEnabled = sender.Enabled; _channelLoggingLevel = sender.Level; }

var level = LoggingLevel.Error;if (_isLoggingEnabled && level >= _channelLoggingLevel) { channel.LogMessage("Message to log", level); channel.LogValuePair("Count", 42, level); }

var channel = new LoggingChannel ("ChannelName");channel.LoggingEnabled += (sender, args) => { _isLoggingEnabled = sender.Enabled; _channelLoggingLevel = sender.Level; }

Page 19: Making your Windows Store  app  more reliable

LoggingSession examplevar session = new LoggingSession("Session Name");session.AddLoggingChannel(channel, LoggingLevel.Warning);

//when error detected, save the log session to disk then uploadStorageFile logFile = await session.SaveToFileAsync(logFolder, name)//background uploader code omitted

Page 20: Making your Windows Store  app  more reliable

Memory Buffer

Log all events to disk.

Send log file when file reaches a specified size.

Flush log memory buffer to disk on crash and send just like in the log to memory example.

Logging to disk

File Logging SessionLogging

Channel

Logging Channel

Logging Channel

Logging Channel

Log File

Your Backen

d

Background Uploader

File Size Limit reached

Log File

Page 21: Making your Windows Store  app  more reliable

FileLoggingSession examplevar session = new FileLoggingSession("Session Name");session.AddLoggingChannel(channel, LoggingLevel.Warning);

session.LogFileGenerated += (senders, args) => { //when file generated, move it so it doesn’t get overwritten await args.File.MoveAsync(logFolder); //background uploader code omitted}

//Flush log to disk on demandvar file = await session.CloseAndSaveToFileAsync();

Page 22: Making your Windows Store  app  more reliable

Windows 8.1 improves exception interop and provides a mechanism to observe unhandled errors before process termination.

Page 23: Making your Windows Store  app  more reliable

Use XAML’s UnhandledException event if you wish, especially if you’re a managed developer.

CoreApplication.UnhandledErrorDetected is better for C++ developers and logging components.

Page 24: Making your Windows Store  app  more reliable

UnhandledErrorDetected exampleCoreApplication.UnhandledErrorDetected += (sender, args) => { try { args.UnhandledError.Propagate(); } catch (Exception ex) { channel.LogMessage(ex.Message, LoggingLevel.Critical); //code to save log and background upload omitted throw; }};

Page 25: Making your Windows Store  app  more reliable

XAML’s UnhandledException exampleApp.Current.UnhandledException += (sender, args) => { channel.LogMessage(args.Exception.Message, LoggingLevel.Critical); //code to save log and background upload omitted};

Page 26: Making your Windows Store  app  more reliable

Demo: Add logging code to my app

Page 27: Making your Windows Store  app  more reliable

Monitor and regularly improve the quality of your app in order to avoid the #1 cause of bad reviews.

Page 28: Making your Windows Store  app  more reliable

Regularly review your app’s quality telemetry on the Windows Dev Center.

Log what is happening inside your application.

Take advantage of new logging and error APIs in Windows 8.1

Summary

Page 29: Making your Windows Store  app  more reliable

Related Sessions2-138 – Improve Application Health by Leveraging Crash Analytics Collected from End Users3-133 – Testing your C#-based Windows Store app: Top 10 areas to look for bugs 4-107 – Windows Runtime Internals: Understanding the threading model

Page 30: Making your Windows Store  app  more reliable

Evaluate this session

Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!

Page 31: Making your Windows Store  app  more reliable

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.