Grandes Mentes Pensam Igual

Page 1

Trilha – Mobile Ricardo da Silva Ogliari Desenvolvedor Mobile na FingerTips

Globalcode – Open4education


Eu

Globalcode – Open4education


Eu 8 anos de Mobile Perto de 150 publicações...

Globalcode – Open4education


Agenda Introdução UI Internacionalização - i18n Aplicativos nativos Persistência de Dados

Globalcode – Open4education


Introdução Passado

Globalcode – Open4education


Introdução Presente

Globalcode – Open4education


Introdução

“Grandes mentes pensam igual”

Globalcode – Open4education


Interfaces Gráficas Drag-and-Drop Android

Globalcode – Open4education


Interfaces Gráficas - iOS

http://365cloud.internaldrive.com/2011/10/ios5_simple_xcode_start.jpg Globalcode – Open4education


Interfaces Gráficas - WP

Globalcode – Open4education


Interfaces Gráficas

http://www.nacionalnet.com.br/portal/img/users/14/Image/espetaculo.jpg

Globalcode – Open4education


Introdução

XML Extensible Markup Language

Globalcode – Open4education


UI - Android <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/bg_buttons" android:gravity="center" android:padding="10dp" > <ToggleButton android:id="@+id/mapa_button" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ToggleButton android:id="@+id/lista_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" Globalcode – Open4education


UI – iOS - Xib < ? x m l v e r s i o n = " 1 . 0 " e n c o d i n g = " U T F- 8 " ? > <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02"> <data> <int key="IBDocument.SystemTarget">1050</int> <string key="IBDocument.SystemVersion">9F33</string> <string key="IBDocument.InterfaceBuilderVersion">672 </string> <string key="IBDocument.AppKitVersion">949.34</string> <string key="IBDocument.HIToolboxVersion">352.00 </string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="57"/> <integer value="372"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilderKit</string> <string>com.apple.InterfaceBuilder.CocoaPlugin </string> </object> Globalcode – Open4education


Interfaces Gráficas - Xib Ib = Interface Builder Xcode = x Xib

Globalcode – Open4education


Interfaces Gráficas - xaml <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="Transparent"> <!--Pivot Control--> <controls:Pivot Title="III Fórum Latino Americano"> <!--Pivot item one--> <controls:PivotItem Header="Sexta"> <!--Double line list with text wrapping--> <ListBox x:Name="FirstListBox" Margin="0,0,-12,0" ItemsSource="{Binding Sexta}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,17" Width="432" Height="78"> <TextBlock Text="{Binding Evento}" TextWrapping="NoWrap" TextTrimming="WordEllipsis" Style="{StaticResource PhoneTextExtraLargeStyle}"/> <TextBlock Text="{Binding Horario}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </controls:PivotItem>

Globalcode – Open4education


Interfaces GrĂĄficas - xaml eXtensible Application Markup Language Competidor do OpenLaszlo do mundo Java Utilizado pela Microsoft desde o Windows Vista

Globalcode – Open4education


Internacionalização Android XML com descrição dos textos; Pastas com código do país; Duplicação das pastas e XML´s; Android internacionaliza seu app

Globalcode – Open4education


Internacionalização iOS Pastas com final lproj – – –

French.lproj German.lproj etc

Dentro da pasta temos um arquivo .string

Globalcode – Open4education


Internacionalização L is t a g e m 8 . E n g lis h .lp r o j/c o n fig .s tr i n g s " P r e f e re n c e s" = " P r ef e re n c e s"; " W in d o w " = " W in d o w " ; " S e ssio n " = " S essio n " ; " C o ls:" = " C o ls:" ; " R o w s:" = " R o w s:" ; " F o n t " = " F o n t"; " N o n - A S C I I F o n t " = " N o n-A S C I I F o n t " ; " A n t i - A l i a s i n g " = " A n t i- A l i a s i n g " ; " C a n c e l" = " C a n c e l"; "O K " = "O K "; " N a m e :" = " N a m e:" ; " E n c o d in g :" = " E n c o d in g :" ; " T r a n s p a r e n c y : " = " T r a n s p a r e n c y :" ; " T e x t :" = " T e x t :" ; " S e le c t io n :" = " S e le c t io n :"; " B a c k g r o u n d :" = " B a c k g r o u n d :" ; " B o ld :" = " B o ld :" ; " I d le c h a r a c te r " = " I d le c h a ra c te r"; " A S C II c o d e :" = " A S C II c o d e :" ; Globalcode – Open4education


Internacionalização L is t a g e m 9 . F r e n c h .lp r o j/c o n fig .s tr i n g s " P r e f e re n c e s " = " P r ef e re n c e s "; " W in d o w " = " F e n ê tre " ; " S e ssio n " = " S e ssio n " ; " C o ls:" = " C o lo n n e s:" ; " R o w s:" = " L ig n e s:" ; " F o n t " = " P o lic e "; " N o n - A S C I I F o n t" = " P o lice n o n-A S C I I " ; " A n t i-A liasin g " = " L issa g e d u t e x t e" ; " C a n c e l" = " A n n u le r"; "O K " = "O K "; " N a m e :" = " N o m :" ; " E n c o d in g :" = " E n c o d a g e :" ; " T r a n s p a re n c y :" = " T r an s p a re n c e :"; " T e x t:" = " T e x te:" ; " S e le c t io n :" = " Sé le c t io n :"; " B a c k g r o u n d : " = " A r r i è r e- p l a n : " ; " B o ld :" = " G ra s:" ; " Id le c h a r a c te r " = " C a ra c tère in ac tif"; " A S C II c o d e :" = " C o d e A S C II:" ; Globalcode – Open4education


Internacionalização Windows Phone Criar arquivos .resx –

XML

Mesmo nome do arquivo + cultura – –

traducao.resx traducao.pt-BR.resx

Application – Assembly Information Arquivo csproj, editar Supported Cultures

Globalcode – Open4education


Aplicativos Nativos Android O segredo é a Intent – –

Uma ação Uma URI

Globalcode – Open4education


Aplicativos Nativos iOS O segredo é a openURL Os parâmetros definem a ação

Globalcode – Open4education


Aplicativos Nativos IOS – Chamar Mapa NSString* searchQuery = @"1 Infinite Loop, Cupertino, CA 95014"; searchQuery = [addressText stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString* urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", searchQuery]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]]; Globalcode – Open4education


Aplicativos Nativos IOS – Enviar e_mail [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://teste@email.com"]];

IOS – Chamada telefônica [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://99887766"]];

IOS – Enviar SMS [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:99887766"]]; Globalcode – Open4education


Aplicativos Nativos Windows Phone Conceito de Launcher e Chooser Launcher – Sem retorno Chooser – Com retorno Launcher – Tasks Definir parâmetros Mostrar...

Globalcode – Open4education


Persistência de Dados Vários meios SQLite Par chave-valor

Globalcode – Open4education


Persistência de Dados Android SharedPreferences Persiste dados primitivos no formato chavevalor; –

Booleans, floats, int, longs e Strings

1) Instância de SharedPreferences 2) Utilizar um dos métodos get: getBoolean, getInt, getFloat... 3) Instância de SharedPreferences.Editor 4) Utilizar um dos métodos put e depois commit Globalcode – Open4education


Persistência de Dados iOS NSUserDefaults

Globalcode – Open4education


Persistência de Dados - ( v o id ) in s e r e { 1 : N S U s e r D e fa u lts * o b je to = [ N S U se rD e fa u lts s ta nd a r d U s e r D e fa ults ] ; 2 : [ o b je to s e tO b je c t: @ " h ttp : / / w w w .m o b ilid a d e tu d o .c o m " fo rK e y :@ " b lo g" ] ; 3 : [ o b je to s e tO b je c t: @ " M o b ilid a d e é T u d o " fo rK e y :@ " n o m e B lo g " ] ; 4 : [ o b je to s y n ch r o n ize ] ; } - ( v o id ) r e cu p e ra { 5 : N S U s e r D e fa u lts * o b jP r e fs = [ N S U s e r D e fa u lts s ta n d a r dU s e rD e fa u lts ]; 6 : N S S tr in g * b lo g = [ o b jP re fs s tr in g F o r K e y : @ " b lo g " ] ; 7 : N S S tr in g * n o m e B lo g = [ o b jP r e fs s tr ing F o rK e y : @ " n o m e B lo g " ] ; } Globalcode – Open4education


PersistĂŞncia de Dados Windows Phone Isolated Storage

Globalcode – Open4education


Persistência de Dados Windows Phone TryGetValue Contains Add Save

Globalcode – Open4education


Introdução

“Grandes mentes pensam igual?”

Globalcode – Open4education


PERGUNTAS???? http://www.mobilidadetudo.com @mobilidadetudo http://itweb.com.br/blog/mobilidade-e-tudo/ rogliariping@gmail.com

OBRIGADO Globalcode – Open4education


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.