Xamarin.Forms Introduction to Xamarin Who is this guy? Cross - - PowerPoint PPT Presentation

xamarin forms introduction to xamarin who is this guy
SMART_READER_LITE
LIVE PREVIEW

Xamarin.Forms Introduction to Xamarin Who is this guy? Cross - - PowerPoint PPT Presentation

Xamarin.Forms Introduction to Xamarin Who is this guy? Cross platform developer RedBull Event @ The London Eye Architecting Mobile Apps Build Apps Multiple Times Lowest Common Denominator Xamarin Standard App Architecture


slide-1
SLIDE 1

Xamarin.Forms

slide-2
SLIDE 2

Introduction to Xamarin

slide-3
SLIDE 3

Who is this guy?

slide-4
SLIDE 4

Cross platform developer

slide-5
SLIDE 5

RedBull Event @ The London Eye

slide-6
SLIDE 6

Architecting 
 Mobile Apps

slide-7
SLIDE 7

Build Apps Multiple Times

slide-8
SLIDE 8

Lowest Common Denominator

slide-9
SLIDE 9

Xamarin Standard App Architecture

▪ Business logic, data models and common code shared between all platforms. ▪ All platform-specific UI and API calls are in C# as well. ▪ Retain fine-grain control app user interface ▪ Recommended for sophisticated UX requirements (complicated gestures, animations, design)

Shared App Logic iOS ¡UI Android ¡UI Windows ¡UI

slide-10
SLIDE 10

Native Performance

.IPA .APK Xamarin.Android takes advantage of Just In Time (JIT) compilation on the Android device. Xamarin.iOS does full Ahead Of Time (AOT) compilation to produce an ARM binary for Apple’s App Store.

slide-11
SLIDE 11

iOS Performance

iPad Air 2 iPhone 6

https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976

slide-12
SLIDE 12

Android Performance

HTC Nexus 9 Moto X(2014)

https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976

slide-13
SLIDE 13

Windows APIs

slide-14
SLIDE 14

iOS APIs | 100% Coverage

slide-15
SLIDE 15

Android APIs | 100% Coverage

slide-16
SLIDE 16

16

iOS: 33,000+ Android: 40,000+

APIs

slide-17
SLIDE 17

Traditional Demo

slide-18
SLIDE 18

Portable ¡Class ¡Libraries

slide-19
SLIDE 19

Considerations

  • Not for all types of apps
  • Is your app very customised?
  • Great for data driven apps
  • Utility apps
  • Also supports maps

Metroon for iOS

slide-20
SLIDE 20

Xamarin App Architectures

Shared App Logic

iOS C# UI Android C# UI Windows C# UI

Shared App Logic Xamarin.Forms

Option for OS – specific UI/UX elements

Recommended for: Sophisticated UX (complicated gestures, animations, design)

Option for 100% code share

Recommended for: forms-based, apps with a lot of data entry screens

slide-21
SLIDE 21

Xamarin.Forms

Quickly and easily build native user interfaces using shared code Xamarin.Forms elements map to native controls and behaviours Mix-and-match Xamarin.Forms with native APIs Shared UI Code

slide-22
SLIDE 22

What’s Included

▪ 40+ Pages, Layouts, and Controls ▪ Build from code behind or XAML ▪ Two-way Data Binding ▪ Navigation ▪ Animation API ▪ Dependency Service ▪ Messaging Center Shared UI Code

slide-23
SLIDE 23

Microsoft XAML vs Xamarin.Forms

  • Xamarin.Forms conforms to the XAML 2009 specification; the different

are really in the controls and layout containers you use

Microsoft XAML (WinRT) Xamarin.Forms

slide-24
SLIDE 24

Feature Supported in Xamarin.Forms XAML 2009 compliance Yes Shapes (Rectangles, Ellipse, Path, etc.) BoxView Resources, Styles and Triggers Yes Data binding Yes Data templates Yes Control Templates Custom Renderers Render Transforms Yes Animations Code Only Custom XAML behaviors Yes Custom markup extensions Yes Value converters Yes

slide-25
SLIDE 25

Pages

Content MasterDetail Navigation Tabbed Carousel

slide-26
SLIDE 26

Layouts

Stack Absolute Relative Grid ContentView ScrollView Frame

slide-27
SLIDE 27

Controls

ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView Map OpenGLView Picker ProgressBar SearchBar Slider Stepper TableView TimePicker WebView EntryCell ImageCell SwitchCell TextCell ViewCell

slide-28
SLIDE 28

Demo

slide-29
SLIDE 29

Pages

  • Single screen of content
  • ContentPage holds one visual

element ContentPage

Control Content property

slide-30
SLIDE 30

Layout

  • Layouts handle child elements
  • Layouts come in two types:

managed and unmanaged ContentPage

Layout Content property Control Control Control Control Children Layout

slide-31
SLIDE 31

Demo

slide-32
SLIDE 32

Plugins for Xamarin

Share even more code Abstracts platform features

  • Vibrate
  • Location
  • Connectivity
  • Battery status
  • Device Info
  • ImageCircles
  • Settings
  • Text to speech
  • External maps
slide-33
SLIDE 33

var ¡locator ¡= ¡CrossGeolocator.Current; ¡ locator.DesiredAccuracy ¡= ¡50; ¡ var ¡position ¡= ¡await ¡locator.GetPositionAsync ¡(timeout: ¡10000); ¡ Console.WriteLine ¡("Position ¡Status: ¡{0}", ¡position.Timestamp); ¡ Console.WriteLine ¡("Position ¡Latitude: ¡{0}", ¡position.Latitude); ¡ Console.WriteLine ¡("Position ¡Longitude: ¡{0}", ¡position.Longitude);

Example location code

slide-34
SLIDE 34

Flash Quiz

slide-35
SLIDE 35

Flash Quiz

  • True
  • False

Xamarin.Forms uses native controls on each platform to render a UI

slide-36
SLIDE 36

Flash Quiz

  • True
  • False

Xamarin.Forms uses native controls on each platform to render a UI

slide-37
SLIDE 37

Flash Quiz

  • True
  • False

Tom wants to build an application that has a pixel perfect layout on both iPhone and iPad devices, Xamarin.Forms would be the perfect choice for this application

slide-38
SLIDE 38

Flash Quiz

  • True
  • False

Tom wants to build an application that has a pixel perfect layout on both iPhone and iPad devices, Xamarin.Forms would be the perfect choice for this application

slide-39
SLIDE 39

Flash Quiz

  • True
  • False

Xamarin.Forms is perfect for prototyping and quick data-entry type applications which do not require many custom UI elements

slide-40
SLIDE 40

Flash Quiz

  • True
  • False

Xamarin.Forms is perfect for prototyping and quick data-entry type applications which do not require many custom UI elements

slide-41
SLIDE 41

Thanks! Questions?

Mike James

Developer Evangelist, Xamarin

mike@xamarin.com http://mikecodes.net @mikeCodesDotNet