24
Hitchhiker's Guide to Using Xamarin with RESTful Services Heather Downing

Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Embed Size (px)

Citation preview

Page 1: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Hitchhiker's Guide to Using Xamarin with RESTful ServicesHeather Downing

Page 2: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Intro

Page 3: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Heather Downing

@[email protected]

❖ Technical focus in .Net & mobile apps

❖ Experience working with Fortune 500 companies

❖ Speaker and entrepreneur

❖ Horseback Archery Competitor

❖ Tolkien Enthusiast

❖ Avid Star Trek TNG Fan

Page 4: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Content1. 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

7. Additional Thoughts

Page 5: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

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)

❖Connect to your REST service with your Xamarin Forms app

Page 6: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Environment Preparation

Page 7: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

DEMO: Emulators

Page 8: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Xamarin Android Player

https://xamarin.com/android-player

Page 9: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

xCode iOS Simulator

http://developer.apple.com/

xcode/

Page 10: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

The Xamarin Forms Approach

Page 11: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

“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

Page 12: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

DEMO: Consuming REST

Page 13: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Xamarin TodoREST App

https://developer.xamarin.com/samples/xamarin-forms/WebServices/TodoREST/

Page 14: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

REST API Overview

Page 15: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Todo REST APIRequires BASIC AUTHENTICATION (Requires Username & Password)

Provides CRUD endpoints for Todo Items

Might benefit from adding machine documentation such as Swagger to more easily visualize Request and Response objects

Hosted on Azure Mobile App Service

Not currently connected to any database

Page 16: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Xamarin TodoREST Service

https://github.com/xamarin/xamarin-forms-samples/tree/master/WebServices/TodoREST/

TodoRESTService

Page 17: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

DEMO: Publishing API

Page 18: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Swagger (Swashbuckle

for .Net)https://github.com/domaindrivendev/

Swashbuckle

http://swagger.io/

Page 19: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

Additional Thoughts

Page 20: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

“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’

Page 21: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

ResourcesWeb 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

Page 22: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

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.

Page 23: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services
Page 24: Hitchhicker's Guide to Using Xamarin Forms with RESTful Services

So long and thanks for all the fish.Presentation Download:http://www.slideshare.net/quorralyne/

Heather Downing

@[email protected]