SlideShare a Scribd company logo
“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

PDF
Xamarin DevDays Portland - iOS 9
PPTX
Introduction to Xamarin.Forms 2.x
PPTX
Xamarin for iOS developers
PDF
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
PDF
TechEvent BASTA von WPF nach Angular in 60 Minuten
PPTX
Cross-platform Apps using Xamarin and MvvmCross - Martijn van Dijk - Codemoti...
PDF
10 Awesome Xamarin.Forms Tips & Tricks
PDF
Hangout: Novidades do Xamarin
Xamarin DevDays Portland - iOS 9
Introduction to Xamarin.Forms 2.x
Xamarin for iOS developers
Xamarin Dev Days - Introduction to Xamarin.Forms, Insights, Test Cloud
TechEvent BASTA von WPF nach Angular in 60 Minuten
Cross-platform Apps using Xamarin and MvvmCross - Martijn van Dijk - Codemoti...
10 Awesome Xamarin.Forms Tips & Tricks
Hangout: Novidades do Xamarin

What's hot (19)

PPTX
Mobile development strategies with MVVM
PDF
End to-end native iOS, Android and Windows apps wtih Xamarin
PPTX
Desarrollo de aplicaciones Windows Phone con Silverlight 8.1
PDF
Xamarin: The Future of App Development
PDF
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
PDF
Azure App Service Helpers
PDF
4 JavaScript Tools Every Designer Should Know About
PDF
Introduction to iOS 9 (Xamarin Evolve 2016)
PDF
Evovle 2016 - Everyone Can Create Beautiful Apps with Material Design
DOCX
PDF
.NET Everywhere and for Everyone
PDF
Finding the sweet spot - blending the best of native and web
PPTX
Making Cross-Platform apps with Xamarin
PDF
HalfStack fast but not furious
PDF
Features in love
PPTX
Build2020: Xamarin.Forms Experts Q&A
PDF
WP-CLI For The Win
PDF
Building 5 star review apps with Xamarin Test Cloud
PPTX
Accelerating Xamarin Development
Mobile development strategies with MVVM
End to-end native iOS, Android and Windows apps wtih Xamarin
Desarrollo de aplicaciones Windows Phone con Silverlight 8.1
Xamarin: The Future of App Development
Bienvenido .Net MAUI - la evolución de Xamarin.Forms
Azure App Service Helpers
4 JavaScript Tools Every Designer Should Know About
Introduction to iOS 9 (Xamarin Evolve 2016)
Evovle 2016 - Everyone Can Create Beautiful Apps with Material Design
.NET Everywhere and for Everyone
Finding the sweet spot - blending the best of native and web
Making Cross-Platform apps with Xamarin
HalfStack fast but not furious
Features in love
Build2020: Xamarin.Forms Experts Q&A
WP-CLI For The Win
Building 5 star review apps with Xamarin Test Cloud
Accelerating Xamarin Development
Ad

Viewers also liked (20)

PPTX
Student managed fund final
PPT
Mobile 2000
PPTX
Evaluation Part 1
DOC
Nitesh Tiwari resume
PPTX
презентация на ресепшин
PPTX
Autodesk inventor basic tools
PPT
Stateof cto career_2002
PPTX
Presentasi april mei cantik
PPT
1 pigmentation
PPT
10 basics of human genetics
PDF
Using Hadoop
DOCX
Nagaraj
PPTX
Personal development
PPTX
observasi psikologi pendidikan MAN 2 Model Medan
PDF
[하종욱 설명서] IN 기아자동차
PDF
Push to pull
PPTX
ERAMIS Tempus Project
PPT
Dions globalsoa web2presentation1_2006
PPT
Washdc cto-0905-2003
PPTX
PROMIS Tempus Project
Student managed fund final
Mobile 2000
Evaluation Part 1
Nitesh Tiwari resume
презентация на ресепшин
Autodesk inventor basic tools
Stateof cto career_2002
Presentasi april mei cantik
1 pigmentation
10 basics of human genetics
Using Hadoop
Nagaraj
Personal development
observasi psikologi pendidikan MAN 2 Model Medan
[하종욱 설명서] IN 기아자동차
Push to pull
ERAMIS Tempus Project
Dions globalsoa web2presentation1_2006
Washdc cto-0905-2003
PROMIS Tempus Project
Ad

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

PDF
Introduction to Xamarin.Forms
PDF
Your First Xamarin.Forms App
PPTX
Getting started with Appcelerator Titanium
PPT
Cross-Platform Mobile Development in Visual Studio
PDF
App Development: Create Cross Platform Mobile App with .NETStandard 2.0
PPT
Cross-platform mobile dev with Mono
PDF
APAC Webinar: Say Hello To Xamarin.Forms
PPTX
Getting started with titanium
PPTX
Introduction to Xamarin - Confoo 2015
PDF
Hybrid Apps with Ionic Framework
PDF
HTML5 Can't Do That
PPTX
Building your first android app using xamarin (Gill Cleeren)
PDF
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
PDF
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
PDF
Empowering the "mobile web"
PDF
Empowering the Mobile Web - Mills
PDF
Empowering the “Mobile Web” with Chris Mills
PPTX
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
PPTX
Ignite your app development with Angular, NativeScript and Firebase
PPTX
Learning C# iPad Programming
Introduction to Xamarin.Forms
Your First Xamarin.Forms App
Getting started with Appcelerator Titanium
Cross-Platform Mobile Development in Visual Studio
App Development: Create Cross Platform Mobile App with .NETStandard 2.0
Cross-platform mobile dev with Mono
APAC Webinar: Say Hello To Xamarin.Forms
Getting started with titanium
Introduction to Xamarin - Confoo 2015
Hybrid Apps with Ionic Framework
HTML5 Can't Do That
Building your first android app using xamarin (Gill Cleeren)
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Empowering the "mobile web"
Empowering the Mobile Web - Mills
Empowering the “Mobile Web” with Chris Mills
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
Ignite your app development with Angular, NativeScript and Firebase
Learning C# iPad Programming

Recently uploaded (20)

PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
Website Design Services for Small Businesses.pdf
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
assetexplorer- product-overview - presentation
PDF
MCP Security Tutorial - Beginner to Advanced
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Introduction to Windows Operating System
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
iTop VPN Crack Latest Version Full Key 2025
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Website Design Services for Small Businesses.pdf
Salesforce Agentforce AI Implementation.pdf
assetexplorer- product-overview - presentation
MCP Security Tutorial - Beginner to Advanced
Patient Appointment Booking in Odoo with online payment
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Tech Workshop Escape Room Tech Workshop
Advanced SystemCare Ultimate Crack + Portable (2025)
Introduction to Windows Operating System
Topaz Photo AI Crack New Download (Latest 2025)
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
How to Use SharePoint as an ISO-Compliant Document Management System

How To: Mobile "Hello World" With Xamarin and Visual Studio 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.