68
SESSÃO: DESENVOLVIMENTO TRILHA: WINDOWS STORE APPS © 2013, MVP ShowCast. Evento organizado por MVPs do Brasil com apoio da Microsoft. MVP ShowCast 2013 Windows 8.1 : O que mudou para o desenvolvedor ?

Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Embed Size (px)

DESCRIPTION

Palestra: Windows 8.1: O que mudou para o desenvolvedor? Palestrante: Renato Ibrahim Haddad (MVP ASP.NET/IIS) Realização: 07/11/2013 12h Trilha: Windows Store apps Sessão: Desenvolvimento Evento: MVP ShowCast 2013 Site: http://mvpshowcast.azurewebsites.net

Citation preview

Page 1: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

SESSÃO: DESENVOLVIMENTO TRILHA: WINDOWS STORE APPS

© 2013, MVP ShowCast. Evento organizado por MVPs do Brasil com apoio da Microsoft.

MVP ShowCast 2013

Windows 8.1: O que mudou para o desenvolvedor?

Page 2: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 3: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Geo-location

Proximity

Direct3D Direct2D Direct Write

PlayTo

Contracts

Bing

Azure Mobile

HTML5/CSS XAMLInput Controls

Authentication

Portable

Sensors Playback Capture

Printing

SVGCanvas

Local storage

SMS

StreamsBackground

transfer

Syndication Networking

XML and JSON

Skydrive

Live tiles and toast

Accessibility Data binding

Application services

Threading/timersMemory

managementGlobalization Cryptography

Xbox Live

Page 4: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Geo-location

Proximity

Direct3D Direct2D Direct Write

PlayTo

Contracts

Bing

Azure Mobile

HTML5/CSS XAMLInput Controls

Authentication

Portable

Sensors Playback Capture

Printing

SVGCanvas

Local storage

SMS

StreamsBackground

transfer

Syndication Networking

XML and JSON

Skydrive

Live tiles and toast

Accessibility Data binding

Application services

Threading/timersMemory

managementGlobalization Cryptography

Xbox Live

Page 5: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Geo-location

Proximity

Direct3D Direct2D Direct Write

PlayTo

Contracts

Bing

Azure Mobile

HTML5/CSS XAMLInput Controls

Authentication

Bluetooth

USB

HID WiFi direct

Point of service

3Dprinting

Scanning

WebGL

HTTP

Contacts

Appoint-ments

PDF

Speech synthesis

Diagnostics

Portable

Sensors Playback Capture

Printing

SVGCanvas

Local storage

SMS

StreamsBackground

transfer

Syndication Networking

XML and JSON

Skydrive

Live tiles and toast

Accessibility Data binding

Application services

Threading/timersMemory

managementGlobalization Cryptography

Xbox Live

Page 6: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Geo-location

Proximity

Direct3D Direct2D Direct Write

PlayTo

Contracts

Bing

Azure Mobile

HTML5/CSS XAMLInput Controls

Authentication

Bluetooth

USB

HID WiFi direct

Point of service

3Dprinting

Scanning

WebGL

HTTP

Contacts

Appoint-ments

PDF

Speech synthesis

Diagnostics

Portable

Sensors Playback Capture

Printing

SVGCanvas

Local storage

SMS

StreamsBackground

transfer

Syndication Networking

XML and JSON

Skydrive

Live tiles and toast

Accessibility Data binding

Application services

Threading/timersMemory

managementGlobalization Cryptography

Xbox Live

Page 7: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 8: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 9: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 10: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Hub

<Hub Header=“Novidades Windows 8.1”>

<HubSection Header=“Aplicativos”>

<DataTemplate>

<!-- your content here -->

<HubSection Header=“Serviços“ IsHeaderInteractive=“True“

Background=“#222222“ MinWidth=“250“>

<DataTemplate>

<!-- your content here -->

Page 11: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 12: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

DateTime Pickers

<DatePicker Header=“data inicial:”

CalendarIdentifier=“JapaneseCalendar”

DayFormat=“{}{day.integer} {dayofweek.abbreviated}” YearVisible=“False” />

<TimePicker ClockIdentifier="24HourClock" />

Page 13: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 14: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Flyout

<Button Content="Show">

<Button.Flyout>

<Flyout>

<StackPanel>

<TextBlock FontWeight="Light" Text="Select a name..." />

<TextBox PlaceholderText="Choose a name..." Width="300" />

<Button HorizontalAlignment="Right" Content="Rename" />

</StackPanel>

</Flyout>

</Button.Flyout>

</Button>

Page 15: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Flyout

<Button Content="Options"><Button.Flyout>

<MenuFlyout><MenuFlyoutItem Text="Reset" Click="Reset_Click"/><MenuFlyoutSeparator/><ToggleMenuFlyoutItem Text="Shuffle"

IsChecked="{Binding IsShuffleEnabled, Mode=TwoWay}"/><ToggleMenuFlyoutItem Text="Repeat"

IsChecked="{Binding IsRepeatEnabled, Mode=TwoWay}"/></MenuFlyout>

</Button.Flyout>

</Button>

Page 16: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 17: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 18: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

AppBarButton - Symbols

<AppBarButton Icon="Favorite" Label="Add to Favorites" />

// below is the verbose method for symbol

<AppBarButton Label="Favorite">

<AppBarButton.Icon>

<SymbolIcon Symbol="Favorite" />

</AppBarButton.Icon>

</AppBarButton>

Page 19: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

AppBarButton – Custom Font

<AppBarButton Label="Favorite">

<AppBarButton.Icon>

<FontIcon FontFamily="assets/myfont.ttf#Font Name"

Glyph="H" />

</AppBarButton.Icon>

</AppBarButton>

Page 20: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

AppBarButton - Images

<AppBarButton Label="Favorite">

<AppBarButton.Icon>

<BitmapIcon UriSource="assets/foo.png" />

</AppBarButton.Icon>

</AppBarButton>

Page 21: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

CommandBar

<Page.BottomAppBar>

<CommandBar>

<CommandBar.PrimaryCommands>

<!-- app bar buttons here -->

</CommandBar.PrimaryCommands>

<CommandBar.SecondaryCommands>

<!-- app bar buttons here -->

</CommandBar.SecondaryCommands>

</CommandBar>

</Page.BottomAppBar>

Page 22: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

CommandBar

<Page.BottomAppBar><CommandBar>

<AppBarToggleButton Icon="Shuffle" Label="Shuffle" Click="AppBarButton_Click"/><AppBarToggleButton Icon="RepeatAll" Label="Repeat" Click="AppBarButton_Click"/><AppBarSeparator/><AppBarButton Icon="Back" Label="Back" Click="AppBarButton_Click"/><AppBarButton Icon="Stop" Label="Stop" Click="AppBarButton_Click"/><AppBarButton Icon="Play" Label="Play" Click="AppBarButton_Click"/><AppBarButton Icon="Forward" Label="Forward" Click="AppBarButton_Click"/><CommandBar.SecondaryCommands>

<AppBarButton Icon="Like" Label="Like" Click="AppBarButton_Click"/><AppBarButton Icon="Dislike" Label="Dislike" Click="AppBarButton_Click"/>

</CommandBar.SecondaryCommands></CommandBar>

</Page.BottomAppBar>

Page 23: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 24: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 25: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 26: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 27: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Reason C++ C# JavaScript

1. Shared cache, cookies, credentials ✔

2. Strongly typed headers=fewer bugs in less time

3. Access to cookies and shared cookies

4. Control over caching and shared cache

5. Inject your code modules into the processing pipeline=cleaner, more modular code

✔new!

✔ new! new!

new! ✔ new!

new! ✔ new!

new! new! new!

Page 28: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Exemplo

try

{

var uri = new Uri("http://example.com/datalist.aspx");

var httpClient = new HttpClient();

var result = await httpClient.GetStringAsync(uri);

}

catch (Exception e)

{

}

Page 29: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Setar um cookievar bpf = new HttpBaseProtocolFilter();

var cookieManager = bpf.CookieManager;

var cookie = new HttpCookie("myCookieName", ".example.com", "/");

cookie.Value = "myValue";

cookieManager.SetCookie(cookie);

// Use this base protocol file with an HttpClient

var httpClient = new HttpClient(bpf);

Page 30: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Page 31: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 32: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 33: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Cenários (Windows.Devices.HumanInterfaceDevice)

Uso de impressão digital para autenticação

Scaner de código de barras e leitor de tarja magnética

Uso de Geofence para interagir com app

Gerenciamento de virtual smart cards para acesso remoto

Impressora 3D e Bluetooth

Scanear documentos e imagens com scanners

APIs

Dispositivos

Page 34: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Developing in Windows 8.1

SW dev

HW dev

Page 35: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 36: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Use a síntese de voz para solicitar entrada ao usuário, realçar notificações de aplicativos e caixas de diálogo de mensagens, dar instruções (como navegação passo a passo) e ler conteúdo como mensagens de texto ou email, RSS feeds, livros e resultados de pesquisa

Page 37: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 38: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 39: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 40: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 41: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 42: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 43: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 44: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 45: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Como criarlayouts elegantes

Page 46: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

XAML (markup) – Windows 8 e 8.1

<VisualStateManager.VisualStateGroups>

<VisualStateGroup>

<VisualState x:Name=“PrimaryLayout">

<Storyboard>

</Storyboard>

</VisualState>

</VisualStateGroup>

</VisualStateManager.VisualStateGroups>

Page 47: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

XAML (code behind) – Windows 8

Window.Current.SizeChanged += Window_SizeChanged;

void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e)

{

if (ApplicationView.Value == ApplicationViewState.Filled)

{

VisualStateManager.GoToState(this, “PrimaryLayout", true);

}

}

Page 48: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

XAML (code behind) – Windows 8.1

Window.Current.SizeChanged += Window_SizeChanged;

void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e)

{

if (e.Size.Width >= 500)

{

VisualStateManager.GoToState(this, “PrimaryLayout", true);

}

}

Page 49: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

HTML (CSS) – Windows 8

/* Example CSS */

@media screen and (-ms-view-state: filled){

body{

/* Define primary layout styles here */}

}

Page 50: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

HTML (CSS) – Windows 8.1

/* Example CSS */

@media screen and (min-width: 500px){

body{

/* Define primary layout styles here */}

}

Page 51: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Opcional: Suporte 320px

App especifica a sua largura mínima no

manifesto

Recomendações são similares às da Snapped

View no Windows 8:Reduza o tamanho das margens, do botão Back

e do título

Page 52: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Opcional: Suporte 320px

App Windows 8 em modo compat:A app pode ter qualquer tamanho a partir de 320px

Entre 320px e 500px, app é fixada em 320px com

“pillarboxing”

Quando a app for atualizada para 8.1:Se a app decidir suportar 320px:

A app pode ter qualquer tamanho a partir de 320px

Não há mais o efeito de “pillarboxing”

Page 53: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 54: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

As propriedades

do DataPackage

ajudam o seu

conteúdo a ter

uma visualização

ótima em apps

target

Propriedades de um Share Source

Propriedades atuais no Windows 8

Title

Description

Thumbnail

ContentSourceWebLink

ContentSourceApplicationLink

Novas propriedades no Windows 8.1

Square30x30Logo

LogoBackgroundColor

Page 55: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 56: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Forneça uma descrição do seu

comportamento de Share no manifesto

Feche o painel de Share via código usando

o método DismissUI

Melhorias em Share targets

Page 57: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

WebLinks vincula conteúdo da Web

ApplicationLinks vincula conteúdo da App

ApplicationLinks x WebLinks

Page 58: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 59: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

Apps são mais rápidas no Windows 8.1 sem mudança de código

2x +rápidoList panning

5-30% +rápidotartup de

uma app com ListView

10-20% menorUso de memória em XAML

15-35% +rápidoEdição em uma ListView WinJS

Page 60: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

• Os números de versão da app Windows 8 nunca podem exceder a primeira versão publicada da app Windows 8.1

Page 61: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 62: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 63: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 64: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 65: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 66: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]
Page 67: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]

SESSÃO: DESENVOLVIMENTO TRILHA: WINDOWS STORE APPS

© 2013, MVP ShowCast. Evento organizado por MVPs do Brasil com apoio da Microsoft.

Referências

• Windows 8.1 Preview Product Guide for Developers

• Windows API reference for Windows Store apps

• Windows 8.1 Preview samples

• Windows 8.1 Preview: New APIs and features for developers

• Migrating Windows 8 apps to Windows 8.1 Preview

• Visual Studio 2013 Preview

Page 68: Windows 8.1: O que mudou para o desenvolvedor? [MVP ShowCast 2013 - DEV - Windows Store apps]