20 tooling and diagnostics

41
Matthias Shapiro @matthiasshap Andy Wigley @andy_wigley Tooling and Diagnostics 30 April 2014

Upload: windowsphonerocks

Post on 24-May-2015

95 views

Category:

Technology


3 download

DESCRIPTION

Building Apps for Windows Phone 8.1 Jump Start . Videos at: http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1

TRANSCRIPT

Page 1: 20   tooling and diagnostics

Matthias Shapiro @matthiasshapAndy Wigley @andy_wigley

Tooling and Diagnostics

30 April 2014

Page 2: 20   tooling and diagnostics

This module…

Visual Studio ToolingUniversal Visual Studio toolingXAML toolingBlendWeb Debugging

Windows Phone EmulatorDiagnostics and Memory ProfilingDebugging Tips and Tricks

Page 3: 20   tooling and diagnostics

Visual Studio Tooling – C#

Page 4: 20   tooling and diagnostics

3 Projects in 1 Solution

Windows 8.1 Project

Windows Phone 8.1 Project

Shared Project

Universal App Templates

Page 5: 20   tooling and diagnostics

Existing Windows 8.1 app can add Windows Phone 8.1 project with shared project.

Adding Windows Phone to a Windows App

Page 6: 20   tooling and diagnostics

Share source between converged appsNo binary outputShared Projects support all file types

Code Files .cs, .js, .cpp, .hXAMLImages .png, .jpg…RESWXML, etc

Shared Project in a Universal Solution

Page 7: 20   tooling and diagnostics

Use #if to navigate differences between Windows and PhoneWindows = WINDOWS_APPWindows Phone = WINDOWS_PHONE_APP

Example: Hardware back button is Windows Phone only

#if Compiler Conditionals

#if WINDOWS_PHONE_APPWindows.Phone.UI.Input.HardwareButtons.BackPressed +=

this.HardwareButtons_BackPressed;#endif

Page 8: 20   tooling and diagnostics

Intellisense warns if code is platform specific

Switch project context using navbar

Switching Code Contexts

Page 9: 20   tooling and diagnostics

Quick and easy way to change startup projects

Supported for all Store platformsEnabled if you have more than 1 app project in the solution

Universal Project Targeting

Page 10: 20   tooling and diagnostics

Set as a property in the solution

Launch both projects together

Multi-Project Targeting

Page 11: 20   tooling and diagnostics

Visual Studio Tooling – XAML

Page 12: 20   tooling and diagnostics

Split Design/XAML View

Control Toolbox

Document Outline

Properties Pane

XAML in Visual Studio

Page 13: 20   tooling and diagnostics

Switch View from Windows to PhoneView UI Element In Visual TreeView Set Properties for UI Elements

Viewing And Navigating XAML

Page 14: 20   tooling and diagnostics

Resource IntellisenseShows all available resources for UI Element

Binding IntellisenseShows properties available in current data context

XAML Intellisense

Page 15: 20   tooling and diagnostics

Right click, “Go To Definition”

For resources, opens XAML where resource is defined

For bindings, opens bound object class

“Go To Definition…”

Page 16: 20   tooling and diagnostics

Change display size of the design pane

Change accent, theme

See how XAML looks in all conditions without running several emulators

XAML Device Pane

Page 17: 20   tooling and diagnostics

Tooling Features in C# and XAML

demo

Page 18: 20   tooling and diagnostics

XAML Design and Visual EditingAnimation BuilderControl State EditorSample DataPortable Alignment Guides

Visual Studio Blend

Page 19: 20   tooling and diagnostics

Visual Studio Blend

demo

Page 20: 20   tooling and diagnostics

Attaches IE debugger to emulator browserJavaScript ConsoleDOM Explorer

Debugging Web Pages on Phone

Page 21: 20   tooling and diagnostics

Windows Phone Emulator

Page 22: 20   tooling and diagnostics

Windows Phone Emulator

Windows Phone Virtual MachineRequires HyperV

Emulate screen resolutsions & physical size

Page 23: 20   tooling and diagnostics

Windows Phone EmulatorTouch pass-through for touchscreen devices

Multi-touch simulation

Page 24: 20   tooling and diagnostics

Windows Phone EmulatorTouch pass-through for touchscreen devices

Multi-touch simulation

Rotate emulator

Page 25: 20   tooling and diagnostics

Windows Phone EmulatorTouch pass-through for touchscreen devices

Multi-touch simulation

Rotate emulator

Many more tools

Page 26: 20   tooling and diagnostics

Accelerometer

Drag red dot to change accelerometer readings

Page 27: 20   tooling and diagnostics

Create geolocations liveChange accuracy

Rural, urban, suburban emulation

Create route with geolocations

Navigate route at different speeds

Save and load geolocation set

Location Simulation

Page 28: 20   tooling and diagnostics

Emulate fast, slow or no networks

Simulate good or poor signal strength

Network Simulation

Page 29: 20   tooling and diagnostics

Toggle sensor availability on the device

Simulate phone without NFC or

front facing camera

Sensor Simulation

Page 30: 20   tooling and diagnostics

Mount local directory as SD Cardtest saving and load files from SD Card

SD Card

Page 31: 20   tooling and diagnostics

Simulate all notification types and templates

TileToastBadgeRaw

Notification Simulation

Page 32: 20   tooling and diagnostics

Windows Phone Power Tools

Performance MonitorConnect to emulator for real time diagnostics of full system

Performance RecorderETW trace capturingSelect performance profiles for CPU, GPU, File or Disk I/O, Audio, Video, IE, and many more

Page 33: 20   tooling and diagnostics

Diagnostics and Memory Profiling

Page 34: 20   tooling and diagnostics

Performance and Diagnostics Tool

Diagnostics Tool For RecordingCPU UsageEnergy ConsumptionMemory Usage XAML UI Responsiveness

Page 35: 20   tooling and diagnostics

Memory Profiling

demo

Page 36: 20   tooling and diagnostics

Debugging Tips and Extras

Page 37: 20   tooling and diagnostics

Debug Location toolbar allows:SuspendResume Shutdown

Good for debugging events triggered by lifecycle changes

Debugging Lifecycle Events

Page 38: 20   tooling and diagnostics

In some cases, an app will launch from another app

Share ContractsFile PickersSpeech Commands

Debugging App Launch

Page 39: 20   tooling and diagnostics

JSON Visualizer added to view JSON strings in an easy-to-read format

JSON Visualizer

Page 40: 20   tooling and diagnostics

blogs.msdn.com/b/visualstudioalm/archive/tags/diagnostics

And more…

Page 41: 20   tooling and diagnostics

©2014 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.