48
Windows 8 & Windows Phone 8 Developer story

Windows 8 and windows phone 8 developer story anders bratland

Embed Size (px)

DESCRIPTION

Windows 8 and windows phone 8 developer story by Anders Bratland. Keynote speech at NETwork 2012 http://network-ua.com/

Citation preview

Page 1: Windows 8 and windows phone 8 developer story anders bratland

Windows 8 & Windows Phone 8 Developer story

Page 2: Windows 8 and windows phone 8 developer story anders bratland

So, what’s the latest on Windows 8?

Page 3: Windows 8 and windows phone 8 developer story anders bratland

I went to Redmond to find out!

Page 4: Windows 8 and windows phone 8 developer story anders bratland

… wait for it …

Page 5: Windows 8 and windows phone 8 developer story anders bratland

nothing!!

Page 6: Windows 8 and windows phone 8 developer story anders bratland

Anders Bratland

Microsoft Extended Experts TeamMicrosoft Certified TrainerMetro Trainers

Who am I?

[email protected] @abratland

Page 7: Windows 8 and windows phone 8 developer story anders bratland

Ok, maybe that wasn’t the whole truth about windows 8…

Mobile ServicesMedia ServicesWindows Phone 8

Page 8: Windows 8 and windows phone 8 developer story anders bratland

The state of Windows 8Just releasedDeveloper tools in placeWindows Store in placeFocus on building apps!

Page 9: Windows 8 and windows phone 8 developer story anders bratland

What about Windows Phone 8?

Page 10: Windows 8 and windows phone 8 developer story anders bratland

The state of Windows Phone 8!Built on the same core as Windows 8API’s and features are not the same but they are converging

Page 11: Windows 8 and windows phone 8 developer story anders bratland

Tiles and lock screen notificationsFlipTileData - this is the regular live tile that we are used to seeing in Windows Phone 7 IconicTileData - similar to the FlipTile but follows more closely the Windows Phone design principles and displays an icon instead of an image CycleTileData - can cycle up to 9 images, similar to the Pictures live tile

Page 12: Windows 8 and windows phone 8 developer story anders bratland

New Map controlNokia MapsOffline mapsShared between applicationsBing Maps still works, but is deprecated.

Page 13: Windows 8 and windows phone 8 developer story anders bratland

File and URI Associations

Page 14: Windows 8 and windows phone 8 developer story anders bratland

New Communication and Proximity APIsBluetoothNFC VoIPSpeech

Page 15: Windows 8 and windows phone 8 developer story anders bratland

Introducing: Fast App ResumeAllows your app to always resume no matter where it’s launched from:App listLive TileToastDeep link

If your app is in the back stack then we will resume it

If it’s not then we will launch a new instance

Page 16: Windows 8 and windows phone 8 developer story anders bratland

Enabling FAR in your appNot enabled by default. Why?Protect your user experienceEnsure that apps don’t break

One simple property!New ActivationPolicy attribute on DefaultTask

Page 17: Windows 8 and windows phone 8 developer story anders bratland

How can we build for both?

Page 18: Windows 8 and windows phone 8 developer story anders bratland

Build for Windows Store & Windows PhoneMVVMPortable Class LibraryAbstract away and inject device specific code

Page 19: Windows 8 and windows phone 8 developer story anders bratland

demo

Page 20: Windows 8 and windows phone 8 developer story anders bratland

Thanks' for listening!

[email protected] @abratland

Page 21: Windows 8 and windows phone 8 developer story anders bratland

Communication

& Data

Devices & Printing

WinRT APIsDirectX &

Media

Windows 8Desktop Apps

CC++

Win32

C#VB

.NET SL

HTMLJavaScrip

t

Internet Explore

r

Windows Store Apps

Application Model

XAML

JavaScript

HTML / CSS

CC++

C#VB

Windows Kernel Services

Syste

m

Serv

ices

Vie w

Mod

el

Con

trolle

rK

ern

el

Page 22: Windows 8 and windows phone 8 developer story anders bratland

Share SettingsSearch

App to App Picking

Play To

Page 23: Windows 8 and windows phone 8 developer story anders bratland

demoFile picker

Page 24: Windows 8 and windows phone 8 developer story anders bratland

Search

Page 25: Windows 8 and windows phone 8 developer story anders bratland

demoSearch in Windows 8

Page 26: Windows 8 and windows phone 8 developer story anders bratland

Implementing Search

Page 27: Windows 8 and windows phone 8 developer story anders bratland

Search Anatomy

1. Search box is scoped to the main app on screen

2. Query suggestions provided by the main app on screen• Autocompletes to terms for which the app has search results

3. List of installed Metro style apps that have implemented the search contract

1

2

3

Chris Mayo
Replace with build, talk about main app vs. launch. Provide a search results pane.
Page 28: Windows 8 and windows phone 8 developer story anders bratland

demoImplementing Search

Page 29: Windows 8 and windows phone 8 developer story anders bratland

Share

Page 30: Windows 8 and windows phone 8 developer story anders bratland

demoShare

Page 31: Windows 8 and windows phone 8 developer story anders bratland

Implementing Share

Page 32: Windows 8 and windows phone 8 developer story anders bratland

Sharing From Source to TargetShare Target AppShare Broker

User selects “Share”, active app is sent

event

Activated for sharing

Registers with the DataTransfer

Manager

Source App

Filters list of Target Apps and Quicklinks

User selects Target App or Quicklink

Processes DataPackage contents

Reports Complete

Completes Async calls and returns

Receives event and fills DataPackage

DataPackage lives in source

application

Activate Target as kind shareTarget

Page 33: Windows 8 and windows phone 8 developer story anders bratland

Data PackagePlain text

Formatted text

URI

HTML

Images

Files

Custom data formats

Page 34: Windows 8 and windows phone 8 developer story anders bratland

App Lifecycle

Page 35: Windows 8 and windows phone 8 developer story anders bratland

When Do Apps Run? Windows 8 System manages app lifetimeWindows 7 User manages app

lifetime

Page 36: Windows 8 and windows phone 8 developer story anders bratland

demoTask switching

Page 37: Windows 8 and windows phone 8 developer story anders bratland

Process Lifetime Walkthrough

Running

Terminated

SuspendedApp terminated under memory

pressure without notification

App 1 App 2 App 3 App N

Apps suspend after a short delay

Apps resume instantly from

suspend

Page 38: Windows 8 and windows phone 8 developer story anders bratland

Introducing Suspend

System resources focused on the app that the user is interacting with in the foreground

Inactive apps have no impact on battery life or responsiveness, they are suspended by the OS

Enables instant switching between apps!

Page 39: Windows 8 and windows phone 8 developer story anders bratland

Termination

System needs more memory User switch occurs User closes the app System shutdown Apps crash

Apps do not get notified when they are getting terminated

Page 40: Windows 8 and windows phone 8 developer story anders bratland

Registering for Suspend and Resume is Easy

//Register for the Suspending event and call Current_Suspending when receivedApp.Current.Suspending += Current_Suspending;

//Handle the suspending event and save the current user session using WinJS sessionStatevoid Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e){ //We are getting suspended } //Register for the Resuming event and call resumingHandler when received App.Current.Resuming += Current_Resuming;

void Current_Resuming(object sender, object e){

//We are getting resumed, in general do nothing

}

Page 41: Windows 8 and windows phone 8 developer story anders bratland

Suspend Under the Hood

Suspended apps are not scheduled by the NT Kernel

No CPU, Disk or Network consumed All threads are suspended Apps remain in memory Kernel ensures apps are not suspended in critical

sections that could cause system wide deadlocks Apps instantly resumed from suspend

when brought to foreground

Page 42: Windows 8 and windows phone 8 developer story anders bratland

Launching Apps

Page 43: Windows 8 and windows phone 8 developer story anders bratland

Changing How Apps Are LaunchedApp launch from Start Activate from tile, search, share,

etc.

Page 44: Windows 8 and windows phone 8 developer story anders bratland

App Activation Through ContractsApps are activated through contractsLaunch, search, ShareTarget, etc.

Apps need to initialize contract specific actions

Context is provided

Running App

launch

shareTarget

activated

kind

search

Page 45: Windows 8 and windows phone 8 developer story anders bratland

Activationprotected async override void OnLaunched(LaunchActivatedEventArgs args){ if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) { // Do an asynchronous restore await SuspensionManager.RestoreAsync(); }

if (args.Kind == ActivationKind.Launch) { if ( !string.IsNullOrEmpty ( args.Arguments ) { // handle arguments } } else if ( args.Kind == ActivationKind.ShareTarget ) { } // … }

Page 46: Windows 8 and windows phone 8 developer story anders bratland

Splash Screens During Activation

System provided Splash Screen mechanism provides consistent transition to your app

Shown while Windows launches your app

Presented during activation

Developer provides color and image in app manifest

Apps need to present a window within 15 seconds of activation or the app will be terminated

Page 47: Windows 8 and windows phone 8 developer story anders bratland

Extended Splash Screens

After first run of your app, cache data so next launchcan show content promptly

For apps that need longer toload

1. Have the first view of your app imitate your splash screen

2. On Activated event handler, position yourview appropriately

3. Add a progress indicator or some other interactive UI so the user knows whatthe app is doing

Page 48: Windows 8 and windows phone 8 developer story anders bratland

Most important in Windows 8Fast and fluidModern UI StyleApplication Life CycleContracts

A good released app > a great unreleased app