Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Hitchhiker's Guide to Using

Xamarin with RESTful Services


Heather Downing
Intro
Heather Downing

@quorralyne
DigitalLightCycle.Blogspot.com
quorralyne@gmail.com

❖ Technical focus in .Net & mobile apps

❖ Experience working with Fortune 500


companies

❖ Speaker and entrepreneur

❖ Horseback Archery Competitor


Content
1. Environment Preparation

2. DEMO: Running Xamarin Forms with Emulators

3. The Xamarin Forms Approach

4. DEMO: Consuming a REST Service

5. REST API Overview

6. DEMO: Publishing your Web API Project to Azure


What you will accomplish...
❖ Jumpstart into working with the Xamarin Studio IDE

❖ Run basic app with Xamarin Android Player and/or xCode emulators

❖ Connect to an existing third party REST API with existing app

❖ Creation of a very simple Xamarin Forms application from scratch

❖ Publish a completed Web API project to Azure (inside Visual Studio)


Environment
Preparation
DEMO: Emulators
Xamarin
Android Player
https://xamarin.com
/android-player
xCode iOS
Simulator
http://developer.apple
.com/xcode/
The Xamarin Forms
Approach
“Xamarin Forms is a very clever and one
might say, elegant, solution to the Write
Once, Run Anywhere, AND Don't Suck
problem.”

- Scott Hanselman
DEMO: Consuming REST
Xamarin
TodoREST App
https://developer.xamarin.
com/samples/xamarin-
forms/WebServices/TodoREST
/
REST API Overview
Todo REST API
Requires BASIC AUTHENTICATION Hosted on Azure Mobile App Service

(Requires Username & Password) Not currently connected to any


database
Provides CRUD endpoints for Todo Items

Might benefit from adding machine


documentation such as Swagger to more
easily visualize Request and Response
objects
Xamarin
TodoREST
Service
https://github.com/xamarin/x
amarin-forms-
samples/tree/master/WebServi
ces/TodoREST/TodoRESTService
DEMO: Publishing API
Swagger
(Swashbuckle
for .Net)
https://github.com/
domaindrivendev/Swashbuckle

http://swagger.io/
Additional Thoughts
“A common mistake that people make when
trying to design something completely
foolproof is to underestimate the ingenuity of
complete fools.”

- Douglas Adams, ‘Hitchhiker’s Guide to the Galaxy’


Resources
Web Services Overview: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/
Consuming RESTful services Using Xamarin Forms: https://developer.xamarin.com/guides/xamarin-forms/web-services/consuming/rest/
Xamarin and Cloud Connected Apps: https://www.youtube.com/watch?v=qIr8xYSTv-I
YouTube Xamarin with REST Presentation: https://www.youtube.com/watch?v=VfoJCd_TMx0

YouTube - Xamarin with REST Presentation: https://www.youtube.com/watch?v=VfoJCd_TMx0


Common Pitfalls in Xamarin Apps: https://university.xamarin.com/guestlectures/avoiding-common-pitfalls-in-xamarin-apps
Azure Mobile Service with Xamarin: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-xamarin-forms-get-started/
Xamarin Forms HttpClient code on Github: https://github.com/conceptdev/xamarin-forms-samples/tree/master/HttpClient
Guide on REST Authentication: https://developer.xamarin.com/guides/xamarin-forms/web-services/authentication/rest/

Example App: https://developer.xamarin.com/samples/xamarin-forms/WebServices%5CTodoREST/


Example App REST Service: https://github.com/xamarin/xamarin-forms-samples/tree/master/WebServices/TodoREST/TodoRESTService
Remember...
One bite at a time, you can
devour this robust and
impressively powerful
framework, and serve it to all
mobile users on a silver platter.
So long and
thanks for all
the fish.

Presentation Download:
http://www.slideshare.net/
quorralyne/

Heather Downing

@quorralyne
quorralyne@gmail.com

You might also like