windows phone 8.1 - platform concepts and app development

39
Dresden, July 16th, 2014 Windows Phone 8.1 platform concepts and app development Advanced seminar by Sebastian Müller

Upload: sebastian

Post on 09-May-2015

1.427 views

Category:

Technology


0 download

DESCRIPTION

In this seminar, app development for Microsoft’s recently announced mobile operating system Windows Phone 8.1 was introduced. The general architecture and many platform concepts are highlighted in these slides. The full paper can be read here: https://www.academia.edu/7712500/Windows_Phone_8.1_-_platform_concepts_and_app_development

TRANSCRIPT

Page 1: Windows Phone 8.1 - platform concepts and app development

Dresden, July 16th, 2014

Windows Phone 8.1platform concepts and app development

Advanced seminar by Sebastian Müller

Page 2: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #2July 16th, 2014

... Windows Mobile 6.5

Windows Phone 7

Windows Phone 8

Windows Phone 8.1

Windows CE

Windows NT

History of Microsoft‘s mobile operating systems

Page 3: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #3July 16th, 2014

Page 4: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #4July 16th, 2014

Hardware requirements

• Snapdragon CPU• 512MB, 1GB or 2GB RAM• 1080p, 720p, WXGA, qHD, FWVGA,

WVGA resolution• multi-touch display• rear-facing camera (VGA)• mobile data, WiFi, Bluetooth 4, A-GPS• accelerometer, proximity, ambient light

sensors• mechanical power, vol+, vol- buttons

Page 5: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #5July 16th, 2014

Apps

Page 6: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #6July 16th, 2014

App models

WP7

Silverlight

WP8

Silverlight

WP 8.1

Silverlight

WP 8.1

WinRT

Silverlight

Windows Phone 8 API

Windows Phone 8.1 API

WinRT

WP 7 API

WP 8.1

WinJS

WinJS

Page 7: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #7July 16th, 2014

App models

WP7

Silverlight

WP8

Silverlight

WP 8.1

Silverlight

WP 8.1

WinRT

Silverlight

Windows Phone 8 API

Windows Phone 8.1 API

WinRT

WP 7 API

WP 8.1

WinJS

WinJS

Page 8: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #8July 16th, 2014

App models

WP7

Silverlight

WP8

Silverlight

WP 8.1

Silverlight

WP 8.1

WinRT

Silverlight

Windows Phone 8 API

Windows Phone 8.1 API

WinRT

WP 7 API

WP 8.1

WinJS

WinJS

Page 9: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #9July 16th, 2014

Windows programming model

HTML / CSS

JavaScript

Windows Runtime

C# / VBC / C++

XAML

Input, Interaction, & Manipulation DirectX, Media, & Composition

Windows Kernel Services

http://channel9.msdn.com/Events/Build/2014/2-507

Page 10: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #10July 16th, 2014

• relatively low-level ABI

• WinRT components act as libraries

• written in C#, C++/CX

• metadata describes underlying API to

managed languages

Windows Runtime

Page 11: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #11July 16th, 2014

Windows Runtime

Chakra

CLRWindows Runtime Object

C++ App

HTML App

C#/VB App

Pro

jectio

nP

roje

ctio

nP

roje

ctio

n

Metadata(winmd)

Page 12: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #12July 16th, 2014

Windows Runtime projection

WinRT Type/Interface .NET Equivalent

Boolean Boolean

DateTime DateTimeOffset

Int64 Long

String String

IMap<K,V> IDictionary<K,V>

IVector<T> IList<T>

Page 13: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #13July 16th, 2014

Windows Runtime projection

WinRT pattern VB/C# pattern JavaScript pattern

AsyncOperation awaitable Task Promise

Event Event, += Event, addEventListener

Delegate Delegate function() …

Collections System.Collections.Generic

Array, hash

Page 14: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #14July 16th, 2014

Windows Runtime

Chakra

CLRWindows Runtime Object

C++ App

HTML App

C#/VB App

Pro

jectio

nP

roje

ctio

nP

roje

ctio

n

Metadata(winmd)

Page 15: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #15July 16th, 2014

Hello World!

Page 16: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #16July 16th, 2014

Development tools

Page 17: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #17July 16th, 2014

Hello world example

Page 18: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #18July 16th, 2014

App.xaml

<Application      x:Class="HelloWorldApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">   <Application.Resources>         <SolidColorBrush x:Name="HelloWorldColorBrush" Color="Red" /> </Application.Resources>         </Application>

Page 19: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #19July 16th, 2014

App.xaml.cs

public sealed partial class App : Application { public App() { InitializeComponent(); Suspending += OnSuspending; } protected override void OnLaunched(LaunchActivatedEventArgs e) { var rootFrame = Window.Current.Content as Frame; //... rootFrame.Navigate(typeof(MainPage), e.Arguments); //... Window.Current.Activate(); } private void FirstNavigated(object sender, NavigationEventArgs e) { //... } private void OnSuspending(object sender, SuspendingEventArgs e) { //... }}

Page 20: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #20July 16th, 2014

Hello Windows Phone!

Page 21: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #21July 16th, 2014

MainPage.xaml

<Page x:Class="HelloWorldApp.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 

  <Page.BottomAppBar <CommandBar> <AppBarButton Label="Hello" Click="BtnClicked" Icon="World"/> </CommandBar> </Page.BottomAppBar>

<Grid VerticalAlignment="Center" HorizontalAlignment="Center">     <TextBlock x:Uid="HelloWorldTxt" x:Name="TextBlock1" Style="{ThemeResource GroupHeaderTextBlockStyle}" Foreground="{ThemeResource PhoneAccentBrush}" Text="Hello world!" /> </Grid></Page>

Page 22: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #22July 16th, 2014

MainPage.xaml.cs

public sealed partial class MainPage : Page {

public MainPage() { InitializeComponent(); NavigationCacheMode = NavigationCacheMode.Required; }

protected override void OnNavigatedTo(NavigationEventArgs e) { //... }

private void BtnClicked(object sender, RoutedEventArgs e) { //... }

}

Page 23: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #23July 16th, 2014

Hello Windows Phone!

Page 24: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #24July 16th, 2014

An app‘s lifecycle

http://msdn.microsoft.com/en-us/library/windows/apps/hh464925.aspx

Page 25: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #25July 16th, 2014

Communication / Contracts

• file associations

• URI contracts

• share

• file save picker

• file open picker

Page 26: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #26July 16th, 2014

Secondary and Live Tiles

http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202948(v=vs.105).aspx

Page 27: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #27July 16th, 2014

Secondary Tiles

http://channel9.msdn.com/Events/Build/2014/2-537

Page 28: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #28July 16th, 2014

Live Tiles

http://msdn.microsoft.com/en-us/library/windows/apps/dn632423.aspx

Page 29: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #29July 16th, 2014

Background tasks

Trigger Usage

System Trigger

UserPresent, UserAway, SessionConnected, TimeZoneChange, NetworkStateChange, InternetAvailable, ServicingComplete, GattCharacteristicNotificationTrigger, DeviceChangeTrigger, DeviceUpdateTrigger, RfcommConnectionTrigger

Run code on system events

TimeTrigger Data synchronization

MaintenanceTrigger Perform maintenance work on AC power

http://channel9.msdn.com/Events/Build/2014/2-518

Page 30: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #30July 16th, 2014

Battery Saver

http://channel9.msdn.com/Events/Build/2014/2-518

Page 31: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #31July 16th, 2014

Action Center

• add/edit/remove

(ghost) notifications

• in-app, triggered,

scheduled, push

Page 32: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #32July 16th, 2014

• Local• isolated• app-specific

• LocalCache• not included in backups

• Roaming• cloud synced• size limit

• Temporary• transient

• PasswordFault• sensitive information

• Project• install folder

Storage and Settings

Page 33: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #33July 16th, 2014

XAML: Images/logo.png

E.g. loads: Images/en-US/homeregion-USA/logo.scale-140_contrast-white.png

Standard naming convention:foldername/qualifiername-value/qualifiername-value/filename.qualifiername-value_qualifier name-value.ext

Resources and localization

Page 34: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #34July 16th, 2014

Key Value

HelloWorldTxt.Text Hello Windows Phone

HelloWorldTxt.Background Blue

HelloWorldTxt.TextAlignment Right

HelloWorldTxt.FlowDirection RightToLeft

Resources and localization

<TextBlock x:Uid="HelloWorldTxt" Style="{ThemeResource GroupHeaderTextBlockStyle}" Foreground="{ThemeResource PhoneAccentBrush}" Text="Hello world!" />

Page 35: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #35July 16th, 2014

App package

ZIP container

Files / Assets

AppXManifest.xml

BlockMap

Signature

• local: appx or appxbundle• cloud:

- machine code for each device- security signature

Page 36: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #36July 16th, 2014

Voice commands

<?xml version="1.0" encoding="utf-8"?><VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1"> <CommandSet xml:lang="en-us" Name="englishCommands"> <CommandPrefix> MSDN </CommandPrefix> <Example> find 'Windows Phone Voice Commands' </Example> <Command Name="MSDNSearch"> <Example> find 'how to install CommandSets' </Example> <ListenFor> Search </ListenFor> <ListenFor> Search [for] {dictatedSearchTerms} </ListenFor> <ListenFor> Find {dictatedSearchTerms} </ListenFor> <ListenFor> Find </ListenFor> <Feedback> Searching MSDN... </Feedback> <Navigate Target="MainPage.xaml" /> </Command> <PhraseTopic Label="dictatedSearchTerms" Scenario="Search"> <Subject> MSDN </Subject> </PhraseTopic> </CommandSet></VoiceCommands>

Page 37: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #37July 16th, 2014

Metro Design Language

Page 38: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #38July 16th, 2014

Metro Design Language

Page 39: Windows Phone 8.1 - platform concepts and app development

Windows Phone 8.1 – platform concepts and app development #39July 16th, 2014

Thank you

Questions