windows 8.1: o que mudou para o desenvolvedor? [mvp showcast 2013 - dev - windows store apps]
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.netTRANSCRIPT
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?
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
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
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
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
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
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
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 -->
DateTime Pickers
<DatePicker Header=“data inicial:”
CalendarIdentifier=“JapaneseCalendar”
DayFormat=“{}{day.integer} {dayofweek.abbreviated}” YearVisible=“False” />
<TimePicker ClockIdentifier="24HourClock" />
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>
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>
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>
AppBarButton – Custom Font
<AppBarButton Label="Favorite">
<AppBarButton.Icon>
<FontIcon FontFamily="assets/myfont.ttf#Font Name"
Glyph="H" />
</AppBarButton.Icon>
</AppBarButton>
AppBarButton - Images
<AppBarButton Label="Favorite">
<AppBarButton.Icon>
<BitmapIcon UriSource="assets/foo.png" />
</AppBarButton.Icon>
</AppBarButton>
CommandBar
<Page.BottomAppBar>
<CommandBar>
<CommandBar.PrimaryCommands>
<!-- app bar buttons here -->
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>
<!-- app bar buttons here -->
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
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>
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!
Exemplo
try
{
var uri = new Uri("http://example.com/datalist.aspx");
var httpClient = new HttpClient();
var result = await httpClient.GetStringAsync(uri);
}
catch (Exception e)
{
}
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);
⛭
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
Developing in Windows 8.1
SW dev
HW dev
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
Como criarlayouts elegantes
XAML (markup) – Windows 8 e 8.1
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name=“PrimaryLayout">
<Storyboard>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
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);
}
}
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);
}
}
HTML (CSS) – Windows 8
/* Example CSS */
@media screen and (-ms-view-state: filled){
body{
/* Define primary layout styles here */}
}
HTML (CSS) – Windows 8.1
/* Example CSS */
@media screen and (min-width: 500px){
body{
/* Define primary layout styles here */}
}
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
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”
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
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
WebLinks vincula conteúdo da Web
ApplicationLinks vincula conteúdo da App
ApplicationLinks x WebLinks
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
• Os números de versão da app Windows 8 nunca podem exceder a primeira versão publicada da app Windows 8.1
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