SlideShare a Scribd company logo
1 of 33
Download to read offline
“HELLO WORLD”
WITH 	

XAMARIN 	

AND 	

VISUAL STUDIO 2013
Presented at the	

Indy .NET Mobile Developers Group, May 2014	

Brad Pillow, PillowSoft LLC
GETTING STARTED: 	

XAMARIN MAC
• Using Android? Install the Android SDK from here:
http://developer.android.com/sdk/index.html#download	

• Using iOS? Sign up to be an iOS developer here and
then download tools: https://developer.apple.com/
programs/ios/	

• Developing for iOS or Android? Download Xamarin tools for
the PC: http://xamarin.com/download#	

• Get your free C#T-Shirt like mine here: https://xamarin.com/
sharp-shirt
GETTING STARTED:	

VS2013
• DownloadVS2013: http://www.visualstudio.com/en-us/
downloads (Note: Xamarin will not work with Express
versions!)	

• Developing for iOS (see previous slide)	

• Developing for Android (see previous slide)	

• Developing for Windows Phone 8? Download: https://
dev.windowsphone.com/en-us/downloadsdk	

• Developing for iOS or Android? Download Xamarin tools for
the PC: http://xamarin.com/download#
PREPARING FORTHISTALK	

• I updated to the alpha release of Xamarin…i.e. my IDE has
the new look and feel	

• I decided to update my Android SDK…bad idea. I got an
error when opening the UI layout file,“layout renders
disconnected”…see this link for a temporary fix: http://
forums.xamarin.com/discussion/14344/disconnected-from-
layout-renderer-error-after-updating-android-sdk-tools-to-
version-22-6	

• Ugh!
PROJECT LAYOUT
IOS
CHOOSING AN IOS PROJECT
IOS STARTUP
IOS DEFAULT STORYBOARD
• Storyboards are view
editing with transition
information	

• Single view project
instantiated a view on
startup
XAMARIN IOS UI EDITOR
IOS RESULT
ADD A BUTTON AND	

CLICK HANDLER
ANDROID
ANDROID SDK INSTALL
CHOOSING AN	

ANDROID PROJECT
STARTINGTHE EMULATOR
STARTINGTHE EMULATOR
ANDROID CODE
ANDROID WITHVIEW EDIT
ANDROID DEFAULTVIEW
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

>

<Button 

android:id="@+id/myButton"

android:layout_width="fill_parent" 

android:layout_height="wrap_content" 

android:text="@string/hello"

/>
<Button 

android:id="@+id/myButton2"

android:layout_width="fill_parent" 

android:layout_height="wrap_content" 

android:text="@string/hello2"

/>

</LinearLayout>



WINDOWS PHONE
WINDOWS PHONE 8.1
• If running in aVM like Parallels, you will need to
turn on nested virtualization: http://
kb.parallels.com/en/115211
WP8 NEW PROJECT
EMPTYVIEW
ADD A BUTTON
AND RUN…
ADD INTERACTION
TOOLSTO STAY CROSS
PLATFORM
• Universal Projects (VS2013, coming to Xamarin): here
and here	

• Shared Project Reference Manager	

• PCL - Portable Class Libraries	

• Project Linker - aliases to files in a project	

• Blog on shared projects forVS2013
BUT I JUST WANTTO DRAW A
PICTURE
• For now…platform specific	

• System.Drawing cross-platform coming from
Xamarin
F# DSL FOR UI
this.mainModel <- new MainViewModel()
!
let payButton = Button (text = "Click Me!")
let subtotalLabel = Label (text = "Subtotal:")
let subtotalTextField = TextField ()
let tipPercentLabel = Label (text = "Tip Percent:")
let tipPercentTextField = TextField ()
let tipPercentSlider = Slider(min = 0., max = 100.)
let totalLabel = Label (text = "Total:")
let totalValueTextField = TextField ()
!
let tipView = View(content = [
subtotalLabel; subtotalTextField;
tipPercentSlider; tipPercentLabel; tipPercentTextField;
totalLabel; totalValueTextField;
payButton;
loadTemplateButton;
loadMarkdownButton;
webView;
])
!
let _ = this.mainModel.TipPercent.Subscribe(fun f -> printfn "slider moved to %f" f)
let _ = this.mainModel.Subtotal.Subscribe(fun f -> printfn “sub-total is %f" f)
!
let altUIBindings = [
Command(payButton, this.mainModel.PayCommand );
Command(loadTemplateButton, loadTemplateCommand );
Command(loadMarkdownButton, loadMarkdownCommand );
ValueToFromFloat(tipPercentSlider, this.mainModel.TipPercent);
ValueToFromString(tipPercentTextField, this.mainModel.TipPercent |> floatToStringProperty);
ValueToString(subtotalTextField, this.mainModel.Subtotal |> floatToStringProperty)
ValueFromString(totalValueTextField, this.mainModel.CalculatedTotal |> floatToStringProperty)
]
GOOD OPEN SOURCE APPS
TO LOOK AT
• My-StepCounter1: builds with
the starter version of Xamarin
and works on iOS and Android
• Tasky Portable2 : a cross
platform task manager.Works
on iOS, Android and Windows
Phone.
1. https://github.com/MichaelJames6/My-StepCounter	

2. http://docs.xamarin.com/content/TaskyPortable/
TIPS
• On iOS, use the simulator as much as you can.Turn
around is fastest with it.	

• On Android, use the device.Turn around is fastest on
it. Also the simulator has a nasty restriction on GREF’s
(handles to native Java objects form C#, i.e. UI
controls).	

• On WP8…I don’t know since I don’t have a device.
THANKS!

More Related Content

What's hot

Features in love
Features in loveFeatures in love
Features in love
bmeme
 

What's hot (20)

Mobile development strategies with MVVM
Mobile development strategies with MVVMMobile development strategies with MVVM
Mobile development strategies with MVVM
 
End to-end native iOS, Android and Windows apps wtih Xamarin
End to-end native iOS, Android and Windows apps wtih XamarinEnd to-end native iOS, Android and Windows apps wtih Xamarin
End to-end native iOS, Android and Windows apps wtih Xamarin
 
Desarrollo de aplicaciones Windows Phone con Silverlight 8.1
Desarrollo de aplicaciones Windows Phone con Silverlight 8.1Desarrollo de aplicaciones Windows Phone con Silverlight 8.1
Desarrollo de aplicaciones Windows Phone con Silverlight 8.1
 
Xamarin: The Future of App Development
Xamarin: The Future of App DevelopmentXamarin: The Future of App Development
Xamarin: The Future of App Development
 
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.FormsBienvenido .Net MAUI - la evolución de Xamarin.Forms
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
 
Azure App Service Helpers
Azure App Service HelpersAzure App Service Helpers
Azure App Service Helpers
 
4 JavaScript Tools Every Designer Should Know About
4 JavaScript Tools Every Designer Should Know About4 JavaScript Tools Every Designer Should Know About
4 JavaScript Tools Every Designer Should Know About
 
Introduction to iOS 9 (Xamarin Evolve 2016)
Introduction to iOS 9 (Xamarin Evolve 2016)Introduction to iOS 9 (Xamarin Evolve 2016)
Introduction to iOS 9 (Xamarin Evolve 2016)
 
Evovle 2016 - Everyone Can Create Beautiful Apps with Material Design
Evovle 2016 - Everyone Can Create Beautiful Apps with Material DesignEvovle 2016 - Everyone Can Create Beautiful Apps with Material Design
Evovle 2016 - Everyone Can Create Beautiful Apps with Material Design
 
Html1
Html1Html1
Html1
 
.NET Everywhere and for Everyone
.NET Everywhere and for Everyone.NET Everywhere and for Everyone
.NET Everywhere and for Everyone
 
Finding the sweet spot - blending the best of native and web
Finding the sweet spot - blending the best of native and webFinding the sweet spot - blending the best of native and web
Finding the sweet spot - blending the best of native and web
 
Making Cross-Platform apps with Xamarin
Making Cross-Platform apps with XamarinMaking Cross-Platform apps with Xamarin
Making Cross-Platform apps with Xamarin
 
HalfStack fast but not furious
HalfStack fast but not furiousHalfStack fast but not furious
HalfStack fast but not furious
 
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone DevelopmentiPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
 
Features in love
Features in loveFeatures in love
Features in love
 
Build2020: Xamarin.Forms Experts Q&A
Build2020: Xamarin.Forms Experts Q&ABuild2020: Xamarin.Forms Experts Q&A
Build2020: Xamarin.Forms Experts Q&A
 
WP-CLI For The Win
WP-CLI For The WinWP-CLI For The Win
WP-CLI For The Win
 
Building 5 star review apps with Xamarin Test Cloud
Building 5 star review apps with Xamarin Test CloudBuilding 5 star review apps with Xamarin Test Cloud
Building 5 star review apps with Xamarin Test Cloud
 
Accelerating Xamarin Development
Accelerating Xamarin DevelopmentAccelerating Xamarin Development
Accelerating Xamarin Development
 

Viewers also liked (6)

How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
How To: Mobile "Hello World" With Xamarin and Visual Studio 2013
 
Immerging Technology, Tools, And Trends
Immerging Technology, Tools, And TrendsImmerging Technology, Tools, And Trends
Immerging Technology, Tools, And Trends
 
Iccns2008 Cp15
Iccns2008 Cp15Iccns2008 Cp15
Iccns2008 Cp15
 
Life In The Fast Lane: August 2014 Indy QS Meetup Presentation
Life In The Fast Lane: August 2014 Indy QS Meetup PresentationLife In The Fast Lane: August 2014 Indy QS Meetup Presentation
Life In The Fast Lane: August 2014 Indy QS Meetup Presentation
 
Appl 1278
Appl 1278Appl 1278
Appl 1278
 
Ieee Transition Of I Pv4 To I Pv6 Network Applications
Ieee Transition Of I Pv4 To I Pv6 Network ApplicationsIeee Transition Of I Pv4 To I Pv6 Network Applications
Ieee Transition Of I Pv4 To I Pv6 Network Applications
 

Similar to How To: Mobile "Hello World" With Xamarin and VS-2013

Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
bryan costanich
 
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Joseph Labrecque
 
Empowering the "mobile web"
Empowering the "mobile web"Empowering the "mobile web"
Empowering the "mobile web"
Chris Mills
 

Similar to How To: Mobile "Hello World" With Xamarin and VS-2013 (20)

Introduction to Xamarin.Forms
Introduction to Xamarin.FormsIntroduction to Xamarin.Forms
Introduction to Xamarin.Forms
 
Your First Xamarin.Forms App
Your First Xamarin.Forms AppYour First Xamarin.Forms App
Your First Xamarin.Forms App
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
App Development: Create Cross Platform Mobile App with .NETStandard 2.0
App Development: Create Cross Platform Mobile App with .NETStandard 2.0App Development: Create Cross Platform Mobile App with .NETStandard 2.0
App Development: Create Cross Platform Mobile App with .NETStandard 2.0
 
Cross-platform mobile dev with Mono
Cross-platform mobile dev with MonoCross-platform mobile dev with Mono
Cross-platform mobile dev with Mono
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.Forms
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
Introduction to Xamarin - Confoo 2015
Introduction to Xamarin - Confoo 2015Introduction to Xamarin - Confoo 2015
Introduction to Xamarin - Confoo 2015
 
Hybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkHybrid Apps with Ionic Framework
Hybrid Apps with Ionic Framework
 
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
Building your first android app using xamarin (Gill Cleeren)
Building your first android app using xamarin (Gill Cleeren)Building your first android app using xamarin (Gill Cleeren)
Building your first android app using xamarin (Gill Cleeren)
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondState of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
 
Empowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris MillsEmpowering the “Mobile Web” with Chris Mills
Empowering the “Mobile Web” with Chris Mills
 
Empowering the Mobile Web - Mills
Empowering the Mobile Web - MillsEmpowering the Mobile Web - Mills
Empowering the Mobile Web - Mills
 
Empowering the "mobile web"
Empowering the "mobile web"Empowering the "mobile web"
Empowering the "mobile web"
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

How To: Mobile "Hello World" With Xamarin and VS-2013

  • 1. “HELLO WORLD” WITH XAMARIN AND VISUAL STUDIO 2013 Presented at the Indy .NET Mobile Developers Group, May 2014 Brad Pillow, PillowSoft LLC
  • 2. GETTING STARTED: XAMARIN MAC • Using Android? Install the Android SDK from here: http://developer.android.com/sdk/index.html#download • Using iOS? Sign up to be an iOS developer here and then download tools: https://developer.apple.com/ programs/ios/ • Developing for iOS or Android? Download Xamarin tools for the PC: http://xamarin.com/download# • Get your free C#T-Shirt like mine here: https://xamarin.com/ sharp-shirt
  • 3. GETTING STARTED: VS2013 • DownloadVS2013: http://www.visualstudio.com/en-us/ downloads (Note: Xamarin will not work with Express versions!) • Developing for iOS (see previous slide) • Developing for Android (see previous slide) • Developing for Windows Phone 8? Download: https:// dev.windowsphone.com/en-us/downloadsdk • Developing for iOS or Android? Download Xamarin tools for the PC: http://xamarin.com/download#
  • 4. PREPARING FORTHISTALK • I updated to the alpha release of Xamarin…i.e. my IDE has the new look and feel • I decided to update my Android SDK…bad idea. I got an error when opening the UI layout file,“layout renders disconnected”…see this link for a temporary fix: http:// forums.xamarin.com/discussion/14344/disconnected-from- layout-renderer-error-after-updating-android-sdk-tools-to- version-22-6 • Ugh!
  • 6. IOS
  • 7. CHOOSING AN IOS PROJECT
  • 9. IOS DEFAULT STORYBOARD • Storyboards are view editing with transition information • Single view project instantiated a view on startup
  • 10. XAMARIN IOS UI EDITOR
  • 12. ADD A BUTTON AND CLICK HANDLER
  • 20. ANDROID DEFAULTVIEW <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android"
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 >
 <Button 
 android:id="@+id/myButton"
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content" 
 android:text="@string/hello"
 /> <Button 
 android:id="@+id/myButton2"
 android:layout_width="fill_parent" 
 android:layout_height="wrap_content" 
 android:text="@string/hello2"
 />
 </LinearLayout>
 

  • 22. WINDOWS PHONE 8.1 • If running in aVM like Parallels, you will need to turn on nested virtualization: http:// kb.parallels.com/en/115211
  • 28. TOOLSTO STAY CROSS PLATFORM • Universal Projects (VS2013, coming to Xamarin): here and here • Shared Project Reference Manager • PCL - Portable Class Libraries • Project Linker - aliases to files in a project • Blog on shared projects forVS2013
  • 29. BUT I JUST WANTTO DRAW A PICTURE • For now…platform specific • System.Drawing cross-platform coming from Xamarin
  • 30. F# DSL FOR UI this.mainModel <- new MainViewModel() ! let payButton = Button (text = "Click Me!") let subtotalLabel = Label (text = "Subtotal:") let subtotalTextField = TextField () let tipPercentLabel = Label (text = "Tip Percent:") let tipPercentTextField = TextField () let tipPercentSlider = Slider(min = 0., max = 100.) let totalLabel = Label (text = "Total:") let totalValueTextField = TextField () ! let tipView = View(content = [ subtotalLabel; subtotalTextField; tipPercentSlider; tipPercentLabel; tipPercentTextField; totalLabel; totalValueTextField; payButton; loadTemplateButton; loadMarkdownButton; webView; ]) ! let _ = this.mainModel.TipPercent.Subscribe(fun f -> printfn "slider moved to %f" f) let _ = this.mainModel.Subtotal.Subscribe(fun f -> printfn “sub-total is %f" f) ! let altUIBindings = [ Command(payButton, this.mainModel.PayCommand ); Command(loadTemplateButton, loadTemplateCommand ); Command(loadMarkdownButton, loadMarkdownCommand ); ValueToFromFloat(tipPercentSlider, this.mainModel.TipPercent); ValueToFromString(tipPercentTextField, this.mainModel.TipPercent |> floatToStringProperty); ValueToString(subtotalTextField, this.mainModel.Subtotal |> floatToStringProperty) ValueFromString(totalValueTextField, this.mainModel.CalculatedTotal |> floatToStringProperty) ]
  • 31. GOOD OPEN SOURCE APPS TO LOOK AT • My-StepCounter1: builds with the starter version of Xamarin and works on iOS and Android • Tasky Portable2 : a cross platform task manager.Works on iOS, Android and Windows Phone. 1. https://github.com/MichaelJames6/My-StepCounter 2. http://docs.xamarin.com/content/TaskyPortable/
  • 32. TIPS • On iOS, use the simulator as much as you can.Turn around is fastest with it. • On Android, use the device.Turn around is fastest on it. Also the simulator has a nasty restriction on GREF’s (handles to native Java objects form C#, i.e. UI controls). • On WP8…I don’t know since I don’t have a device.