41
Postmortem of a UWP C# / XAML application development David CATUHE - @Deltakosh Principal Program Manager [email protected]

Postmortem of a uwp xaml application development

Embed Size (px)

Citation preview

Postmortem of a UWP C# / XAML

application development

David CATUHE - @DeltakoshPrincipal Program Manager

[email protected]

Please welcome…UrzaGatherer 3.x

Tips and tricks for creating a great app

Design tricks for non-designers

1. Watch Dave Crawford’s session (MVA session coming)(Reposition, Reveal, Resize, Replace, Reflow, Re-architect)

2. Pick a technique to adapt your UI

3. Apply

My pick: Reflow• Work perfectly well with Grids• Easy to implement• Move columns to lines when switching to mobile

How to implement reflow?

Convenient tools

That you can use to boost your productivity…

Using code template (.tt) to get typed resources

Overriding effective pixelsOn small devices, you may want to either force bigger or smaller size

Handling navigation inside your app

Using Frame.Navigate

David Catuhe
Need to present integrated navigation service and explain how data is transmitted

How to persist stateA great app has to be able to serialize navigation history

Using a stack of serializable objects is an easy way to keep track of your parameters

Stack can then be serialized using JSON

Do not rely on NavigationCache…… if there are different ways to reach your page because there is only one state per page

Use a serializable state instead…

When to restore my scroll position?Tough question

Performance tricks

Abuse of Task and Parallel.Foreach• C# is incredibly powerful for parallelizing things• Do not forget to use SemaphoreSlim to protect your

critical sections (lock does not work if you have an async code inside)

JSON serialization could be slowMostly when suspendingBut you can ask for more time:

Using debug stopwatchReally useful for debugging local performance issues (Start, suspend, etc..)

Using Visual Studio 2015 profiler

Using Visual Studio 2015 profiler

Debugging your app

Debugging 101

Try/catch everywhere!

Fixing this **** uncatched

exceptionOr how to debug when everything works well

on your computer

First of all, we need toolsAdding AppInsights to your app takes 5 minutes (really)

Enabling AppInsights

And then magic happens…First report was…so sad

220 crashes for 71 users…

Hunting the beast down…

The mystery of “unknown method”

When there is no callstack…Task.Run and Dispatcher.RunAsync has no callstack inside user code

Deploying your app and making it successful

Publishing to the store

C# want to be C++Compiling in Release mode use .NetNative tools chain by default

So it is about generating native code..which is sloooooow……But faster at run time

.NetNative does not support all .Net features:(http://blogs.windows.com/buildingapps/2015/08/20/net-native-what-it-means-for-universal-windows-platform-uwp-developers)

Do not forget to test in release from time to time

Publication

Staying connected with

your users

Analytics are the key

Store AppInsights

Respond to reviews

Analyzing users behavior

Marking your code with “events”

David Catuhe
Need to be done

Do you have any questions?