w w w . l a m b d a 3 . c o m . b r
Desenvolvimento Cross-Mobile
com Xamarin
Mahmoud Ali – Desenvolvedor
@akamud
Xamarin’s Unique Approach
Shared C# codebase • 100% native API access • High performance
iOS C# UI Windows C# UIAndroid C# UI
Shared C# Mobile
Xamarin – Your Complete Mobile Solution
Windows APIs
Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
iOS – 100% API Coverage
MapKit UIKit iBeacon CoreGraphics CoreMotion
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
Android – 100% API Coverage
Text-to-speech ActionBar Printing Framework Renderscript NFC
System.Data System.Windows System.Numerics System.Core System.ServiceModel
System.Net System System.IO System.Linq System.Xml
Native Performance
• Xamarin.iOS faz compilação Ahead
of Time (AOT) em todo o código
para produzir um binário ARM para
a App Store da Apple.
• Xamarin.Android se aproveita dos
benefícios da compilação Just In
Time (JIT) no Android.
Tudo que você consegue fazer com Objective-C, Swift, ou Java
pode ser feito em C# e Visual Studio com Xamarin
✓Sempre atualizado
Suporte
completo para:
• Apple Watch
• Android Wear
• Amazon Fire TV
• Google Glass
Same-day support:
• iOS 5
• iOS 6
• iOS 7
• iOS 7.1
• iOS 8
• iOS 9
• iOS 10
Android Designer
• Criação de UI com drag
and drop
• Teste em múltiplos
tamanhos de telas,
resoluções e versões do
Android
• Layouts salvos em
arquivos XML Android
padrão
Android Hyper-V Emulators for PC
• Multi-Touch
• Super Rápido
• Rotaciona, tira foto,
simula localização e
mais
http://bit.ly/hyperv-android
Sim, você precisa de um Mac
para desenvolver
Xamarin.iOS
Xamarin Designer for iOS
• Familiar para
desenvolvedores no Visual
Studio
• Suporte a todos elementos do
UIKit
• Edita componentes
customizados
• Live preview de mudanças
nas propriedades
Visual Studio iOS Simulator Remoting
• Multi-Touch
• Super rápido
• Rotaciona, tira fotos,
simula localização
• Nunca saia do Visual
Studio
Xamarin Studio – Mac
C# Backend
Compartilhado
Platform
Specific Code
E se a gente não
precisasse escrever
esses códigos?
E se eles fossem
acessíveis do código
compartilhado?
UI+APIs UI + APIsUI + APIs
Battery
GPS
Lights
Notifications
Settings
Text To Speech
Battery
GPS
Lights
Notifications
Settings
Text To
Speech
Battery
GPS
Lights
Notifications
Settings
Text To
Speech
Plugins para Xamarin
API comum
TextToSpeech
Speak(“Hello World”);
AVSpeechSynthesizer SpeechSynthesizer
Xamarin.Forms
Xamarin + Xamarin.Forms
Abordagem Xamarin
tradicional
Com Xamarin.Forms:
mais código compartilhado,
tudo nativo
iOS C# UI Windows C# UIAndroid C# UI
Shared C# Backend
Shared UI Code
Shared C# Backend
<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.MainPage">
<TabbedPage.Children>
<ContentPage Title="Profile" Icon="Profile.png">
<StackLayout Spacing="20" Padding="20"
VerticalOptions="Center">
<Entry Placeholder="Username"
Text="{Binding Username}"/>
<Entry Placeholder="Password"
Text="{Binding Password}"
IsPassword="true"/>
<Button Text="Login" TextColor="White"
BackgroundColor="#77D065"
Command="{Binding LoginCommand}"/>
</StackLayout>
</ContentPage>
<ContentPage Title="Settings" Icon="Settings.png">
<!-- Settings -->
</ContentPage>
</TabbedPage.Children>
</TabbedPage>
Native UI from shared code
O que está incluso
✓ 40+ Pages, layouts, e controls
(code-behind ou XAML)
✓ Two-way data binding
✓ Navigation
✓ Animation API
✓ Dependency Service
✓ Messaging Center
✓ Custom Rendersrs
Shared C# Backend
Shared UI Code
Layouts
Pages
Stack Absolute Relative Grid ContentView ScrollView Frame
Content MasterDetail Navigation Tabbed Carousel
ActivityIndicator BoxView Button DatePicker Editor
Entry Image Label ListView Map
OpenGLView Picker ProgressBar SearchBar Slider
Stepper TableView TimePicker WebView EntryCell
ImageCell SwitchCell TextCell ViewCell
Controls
XAML Previewer
URL Navigation
Themes
https://developer.xamarin.com/guides/xamarin-forms/themes/
Native Embedding
Native Embedding
Shared C# codebase • 100% native API access • High performance
iOS C# UI Windows C# UIAndroid C# UI
Shared C# Mobile C# Server
Linux/Mono
CoreCLRAzure
Shared C# Client/Server
Xamarin Apps + Backend Services
w w w . l a m b d a 3 . c o m . b r
Obrigado!
@akamud
mahmoud.ali@lambda3.com.br

Desenvolvimento Cross-mobile com Xamarin

  • 1.
    w w w. l a m b d a 3 . c o m . b r Desenvolvimento Cross-Mobile com Xamarin Mahmoud Ali – Desenvolvedor @akamud
  • 2.
    Xamarin’s Unique Approach SharedC# codebase • 100% native API access • High performance iOS C# UI Windows C# UIAndroid C# UI Shared C# Mobile
  • 3.
    Xamarin – YourComplete Mobile Solution
  • 4.
    Windows APIs Microsoft.Phone Microsoft.NetworkingWindows.Storage Windows.Foundation Microsoft.Devices System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  • 5.
    iOS – 100%API Coverage MapKit UIKit iBeacon CoreGraphics CoreMotion System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  • 6.
    Android – 100%API Coverage Text-to-speech ActionBar Printing Framework Renderscript NFC System.Data System.Windows System.Numerics System.Core System.ServiceModel System.Net System System.IO System.Linq System.Xml
  • 7.
    Native Performance • Xamarin.iOSfaz compilação Ahead of Time (AOT) em todo o código para produzir um binário ARM para a App Store da Apple. • Xamarin.Android se aproveita dos benefícios da compilação Just In Time (JIT) no Android.
  • 8.
    Tudo que vocêconsegue fazer com Objective-C, Swift, ou Java pode ser feito em C# e Visual Studio com Xamarin
  • 9.
    ✓Sempre atualizado Suporte completo para: •Apple Watch • Android Wear • Amazon Fire TV • Google Glass Same-day support: • iOS 5 • iOS 6 • iOS 7 • iOS 7.1 • iOS 8 • iOS 9 • iOS 10
  • 11.
    Android Designer • Criaçãode UI com drag and drop • Teste em múltiplos tamanhos de telas, resoluções e versões do Android • Layouts salvos em arquivos XML Android padrão
  • 12.
    Android Hyper-V Emulatorsfor PC • Multi-Touch • Super Rápido • Rotaciona, tira foto, simula localização e mais http://bit.ly/hyperv-android
  • 13.
    Sim, você precisade um Mac para desenvolver Xamarin.iOS
  • 14.
    Xamarin Designer foriOS • Familiar para desenvolvedores no Visual Studio • Suporte a todos elementos do UIKit • Edita componentes customizados • Live preview de mudanças nas propriedades
  • 15.
    Visual Studio iOSSimulator Remoting • Multi-Touch • Super rápido • Rotaciona, tira fotos, simula localização • Nunca saia do Visual Studio
  • 16.
  • 17.
  • 18.
    Platform Specific Code E sea gente não precisasse escrever esses códigos? E se eles fossem acessíveis do código compartilhado? UI+APIs UI + APIsUI + APIs Battery GPS Lights Notifications Settings Text To Speech Battery GPS Lights Notifications Settings Text To Speech Battery GPS Lights Notifications Settings Text To Speech
  • 19.
  • 20.
  • 21.
  • 22.
    Xamarin + Xamarin.Forms AbordagemXamarin tradicional Com Xamarin.Forms: mais código compartilhado, tudo nativo iOS C# UI Windows C# UIAndroid C# UI Shared C# Backend Shared UI Code Shared C# Backend
  • 23.
    <?xml version="1.0" encoding="UTF-8"?> <TabbedPagexmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.MainPage"> <TabbedPage.Children> <ContentPage Title="Profile" Icon="Profile.png"> <StackLayout Spacing="20" Padding="20" VerticalOptions="Center"> <Entry Placeholder="Username" Text="{Binding Username}"/> <Entry Placeholder="Password" Text="{Binding Password}" IsPassword="true"/> <Button Text="Login" TextColor="White" BackgroundColor="#77D065" Command="{Binding LoginCommand}"/> </StackLayout> </ContentPage> <ContentPage Title="Settings" Icon="Settings.png"> <!-- Settings --> </ContentPage> </TabbedPage.Children> </TabbedPage> Native UI from shared code
  • 24.
    O que estáincluso ✓ 40+ Pages, layouts, e controls (code-behind ou XAML) ✓ Two-way data binding ✓ Navigation ✓ Animation API ✓ Dependency Service ✓ Messaging Center ✓ Custom Rendersrs Shared C# Backend Shared UI Code
  • 25.
    Layouts Pages Stack Absolute RelativeGrid ContentView ScrollView Frame Content MasterDetail Navigation Tabbed Carousel
  • 26.
    ActivityIndicator BoxView ButtonDatePicker Editor Entry Image Label ListView Map OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell Controls
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
    Shared C# codebase• 100% native API access • High performance iOS C# UI Windows C# UIAndroid C# UI Shared C# Mobile C# Server Linux/Mono CoreCLRAzure Shared C# Client/Server Xamarin Apps + Backend Services
  • 34.
    w w w. l a m b d a 3 . c o m . b r Obrigado! @akamud mahmoud.ali@lambda3.com.br

Notas do Editor

  • #9 Coming up next is bubbles
  • #17 Xamarin Studio on Mac offers: Android, iOS and Mac development World Class IDE with great features: Code Analysis Upload to Test Flight Git & Subversion Integration Code Completion Code Navigation Easy transition from Visual Studio The same Solution & Projects open in BOTH Xamarin Studio and Visual Studio!
  • #26 Inside of a page are layouts A lot of options from something simple like a stack panel to complex and powerful grids
  • #27 You have more than 40 controls, layouts, and pages to mix and match from. These are all of the controls you have out of the box, you can of course create your own. What is unique is you get the native control and have access to it. Consider an Entry Field On iOS it is mapped to UITextField Android it is EditText Windows Phoen it is a TextBox
  • #30 Connect Web to Mobile Simple cross platform API over: CoreSpotlight NSUserActivity Google App Indexing
  • #32 Easily embed any native control into a Xamarin.Forms layout.
  • #33 Just add it as child to a layout. Exposed as an Extension Method.
  • #34 With Xamarin it just isn’t your front end in C# it is your full backend server as well. With Azure or even on Linux running Mono or the CoreCLR your app is fully C# end to end!