SlideShare a Scribd company logo
XAMARIN FORMS
NOOB TO MASTER
By Rendy Del Rosario and Charlin Agramonte
Week 5
Objectives
- Understand what is a Web service
- Understand what is a REST API and how to use in Xamarin
- Consume a real API in Xamarin
Web Service
A web service is a collection of open protocols and standards used for exchanging
data between applications or systems.
For transferring data it uses:
- XML
- JSON
SOAP RESTFUL
TYPES
API (Application Programming Interface)
Is a set of defined functions and methods for interfacing with the underlying
operating system or another program or service running on the computer.
RESTful Web Service
What are REST services?
REST (Representational State Transfer) is an architecture for creating distributed
applications which is modeled around the HTTP specification
Definition
URL HTTP methods
A media type for the
data
https://www.some_address.com/customers GET/POST/PUT/PATCH/DELETE JSON/ XML
Rest operations
- Get
- Post
- Put
- Patch
- Delete
Rest operations: GET
This operation is used to retrieve data from the web service.
https://www.some_address.com/users/
https://www.some_address.com/users/5 https://www.some_address.com/users?id=5
Rest operations: POST
This operation is used to create a new item of data on the web service.
https://www.some_address.com/users/5
Rest operations: PUT
This operation is used to update an item of data on the web service.
https://www.some_address.com/users/5
Rest operations: PATCH
This operation is used to update an item of data on the web service by describing
a set of instructions about how the item should be modified.
https://www.some_address.com/users/5
Rest operations: DELETE
This operation is used to delete an item of data on the web service.
https://www.some_address.com/users/5
Media Types
JSON
JSON (JavaScript Object Notation) is a
lightweight format that is used for data
interchanging. It is based on a subset of
JavaScript language (the way objects are
built in JavaScript).
HttpStatus
The REST service sends an HTTP status code in the
HttpResponseMessage.StatusCode property, to indicate whether the HTTP
request succeeded or failed. The common responses for this operation are:
201 (CREATED)
400 (BAD
REQUEST)
500 (SERVER
ERROR)
404 (NOT FOUND)
Example
Security in REST
- Security is ultimately decided by the service
– the client can only conform to what the
service allows
- Should always prefer https to protect the
data peer-to-peer
REST in Xamarin
Xamarin API Options
HttpClient ServiceStack RestSharp Platform Specific
Most common
approach, built into
.NET
Full fledged 3rd party
web services
framework, has client
PCL for consuming
REST services
Full 3rd party client
library that supports
file downloads,
authentication,
chunking, etc
Native Platform Apis
for networking calls
HttpClient
The HttpClient class is used to send and receive requests over HTTP. It
provides functionality for sending HTTP requests and receiving HTTP
responses from a URI identified resource. Each request is sent as an
asynchronous operation.
HttpClient - Get
JsonConvert is a Json.NET class that can serialize and
deserialize data from a JSON string or stream based on a
specified Type
Deserialize object
JsonConvert.DeserializeObject<ObjectoToStrealize>(text);
HttpClient - Post/Put/Delete
Must serialize body and include encoding and content type
HttpClient customizations
Let’s do it step by step
1-Create an Interface IApiService for your call definitions
2-Create a class ApiService to handle your requests and implement the
previously created interface
3-Implement your request calls in your Api Service and define them in your
Interface
4-Do your calls in your ViewModel
5-Show the data in your views
GROUP EXERCISE
Interact with our first API
INDIVIDUAL EXERCISE
Using the Public API
Create an app for get a RNC of a company
TIME: 45 MINUTES
IOS - NSAppTransportSecurity
App Transport Security (ATS) enforces
secure connections between internet
resources (such as the app's back-end
server) and your app.
Mobile Networks
Applications should always determine whether a network is available
before starting a network operation
INDIVIDUAL EXERCISE
Add connectivity handler to your actual project
TIME: 15 MINUTES
Refit
Refit is a library heavily inspired by Square's Retrofit library, and it turns
your REST API into a live interface
https://github.com/paulcbetts/refit
Helpful tools for Json and Request Handlers
- http://json2csharp.com/
- https://www.getpostman.com/docs/postman/launching_postman/navi
gating_postman
HOMEWORK PRACTICE
Using the Public API for Weather
Create an App to get the Weather of Santo Domingo, DR
Recommended Lectures
- Web Service
https://developer.xamarin.com/guides/xamarin-forms/cloud-services/consuming/
- HttpClient in Xamarin Forms
http://blog.xhackers.co/httpclient-with-xamarin-forms/
https://www.youtube.com/watch?v=xNP-K37mssA
By Rendy Del Rosario and Charlin Agramonte
Week 5
THANK YOU!!!
Ad

More Related Content

What's hot (20)

MVC on the server and on the client
MVC on the server and on the clientMVC on the server and on the client
MVC on the server and on the client
Sebastiano Armeli
 
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
Francesco Lerro
 
Lesson 02 Introduction to XAML
Lesson 02 Introduction to XAMLLesson 02 Introduction to XAML
Lesson 02 Introduction to XAML
Quang Nguyễn Bá
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
daniel plocker
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flex
Joseph Khan
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniIntroduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - Zaloni
Joseph Khan
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
Romain Rochegude
 
Mule velocity
Mule velocityMule velocity
Mule velocity
Praneethchampion
 
Beginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMBeginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAM
harprits10
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
Anton Krasnoshchok
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
 
Automated Testing on iOS
Automated Testing on iOSAutomated Testing on iOS
Automated Testing on iOS
Make School
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application Architecture
Make School
 
Angular introduction basic
Angular introduction basicAngular introduction basic
Angular introduction basic
jagriti srivastava
 
Launching Services in Amazon Web Services
Launching Services in Amazon Web ServicesLaunching Services in Amazon Web Services
Launching Services in Amazon Web Services
James Armes
 
Intro to EmberJS
Intro to EmberJSIntro to EmberJS
Intro to EmberJS
Billy Onjea
 
Late Bound, Early Bound with Demo and Practical in Dynamics 365 Plugin
Late Bound, Early Bound with Demo and Practical in Dynamics 365 PluginLate Bound, Early Bound with Demo and Practical in Dynamics 365 Plugin
Late Bound, Early Bound with Demo and Practical in Dynamics 365 Plugin
Sanjaya Prakash Pradhan
 
Active server pages
Active server pagesActive server pages
Active server pages
student
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
Surbhi Panhalkar
 
MVC on the server and on the client
MVC on the server and on the clientMVC on the server and on the client
MVC on the server and on the client
Sebastiano Armeli
 
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
Francesco Lerro
 
Lesson 02 Introduction to XAML
Lesson 02 Introduction to XAMLLesson 02 Introduction to XAML
Lesson 02 Introduction to XAML
Quang Nguyễn Bá
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
daniel plocker
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flex
Joseph Khan
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniIntroduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - Zaloni
Joseph Khan
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
Romain Rochegude
 
Beginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMBeginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAM
harprits10
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
Anton Krasnoshchok
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
 
Automated Testing on iOS
Automated Testing on iOSAutomated Testing on iOS
Automated Testing on iOS
Make School
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application Architecture
Make School
 
Launching Services in Amazon Web Services
Launching Services in Amazon Web ServicesLaunching Services in Amazon Web Services
Launching Services in Amazon Web Services
James Armes
 
Intro to EmberJS
Intro to EmberJSIntro to EmberJS
Intro to EmberJS
Billy Onjea
 
Late Bound, Early Bound with Demo and Practical in Dynamics 365 Plugin
Late Bound, Early Bound with Demo and Practical in Dynamics 365 PluginLate Bound, Early Bound with Demo and Practical in Dynamics 365 Plugin
Late Bound, Early Bound with Demo and Practical in Dynamics 365 Plugin
Sanjaya Prakash Pradhan
 
Active server pages
Active server pagesActive server pages
Active server pages
student
 

Similar to Xamarin Workshop Noob to Master – Week 5 (20)

Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
kmani5
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).pptTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
HusseinWassof
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
Rest web service
Rest web serviceRest web service
Rest web service
Hamid Ghorbani
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
Google Developer Students Club NIT Silchar
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
Tim Burks
 
gofortution
gofortutiongofortution
gofortution
gofortution
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for Developer
InnoTech
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
Aparna Sharma
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
ukdpe
 
REST API
REST APIREST API
REST API
Kanushka Gayan
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
NamanVerma88
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
EngmohammedAlzared
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
Chalermpon Areepong
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
Er. Prashant Veer Singh
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
Aparna Sharma
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
Knoldus Inc.
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
Mindfire Solutions
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptxTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx
kmani5
 
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).pptTransform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
Transform-to-Smart-ERP-using-Custom-Mobile-Apps.pptx (3).ppt
HusseinWassof
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
Tim Burks
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for Developer
InnoTech
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
Aparna Sharma
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
ukdpe
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
EngmohammedAlzared
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
Aparna Sharma
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
Knoldus Inc.
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
Mindfire Solutions
 
Ad

More from Charlin Agramonte (20)

State machine in .NET
State machine in .NETState machine in .NET
State machine in .NET
Charlin Agramonte
 
Trabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NETTrabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NET
Charlin Agramonte
 
Improving the ux of our xamarin forms apps
Improving the ux of our xamarin forms appsImproving the ux of our xamarin forms apps
Improving the ux of our xamarin forms apps
Charlin Agramonte
 
Integrando un rest api con refit
Integrando un rest api con refitIntegrando un rest api con refit
Integrando un rest api con refit
Charlin Agramonte
 
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin FormsMejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Charlin Agramonte
 
Desenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDDesenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLID
Charlin Agramonte
 
Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms
Charlin Agramonte
 
C# Good practices
C# Good practicesC# Good practices
C# Good practices
Charlin Agramonte
 
Starting my blog
Starting my blogStarting my blog
Starting my blog
Charlin Agramonte
 
C# Best Practices
C# Best PracticesC# Best Practices
C# Best Practices
Charlin Agramonte
 
Como prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile DeveloperComo prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile Developer
Charlin Agramonte
 
Desarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin formsDesarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin forms
Charlin Agramonte
 
C#good practices in 10 minutes
C#good practices in 10 minutesC#good practices in 10 minutes
C#good practices in 10 minutes
Charlin Agramonte
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best Practices
Charlin Agramonte
 
Xamarin Forms Evolution
Xamarin Forms EvolutionXamarin Forms Evolution
Xamarin Forms Evolution
Charlin Agramonte
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesome
Charlin Agramonte
 
Visual studio 2019 launch
Visual studio 2019 launch Visual studio 2019 launch
Visual studio 2019 launch
Charlin Agramonte
 
Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero
Charlin Agramonte
 
Xamarin forms - overcloud
Xamarin forms - overcloudXamarin forms - overcloud
Xamarin forms - overcloud
Charlin Agramonte
 
Xamarin forms from zero to hero
Xamarin forms from zero to heroXamarin forms from zero to hero
Xamarin forms from zero to hero
Charlin Agramonte
 
Trabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NETTrabajando con máquinas de estados en.NET
Trabajando con máquinas de estados en.NET
Charlin Agramonte
 
Improving the ux of our xamarin forms apps
Improving the ux of our xamarin forms appsImproving the ux of our xamarin forms apps
Improving the ux of our xamarin forms apps
Charlin Agramonte
 
Integrando un rest api con refit
Integrando un rest api con refitIntegrando un rest api con refit
Integrando un rest api con refit
Charlin Agramonte
 
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin FormsMejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Mejorando el UX de nuestras aplicaciones móviles en Xamarin Forms
Charlin Agramonte
 
Desenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDDesenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLID
Charlin Agramonte
 
Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms
Charlin Agramonte
 
Como prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile DeveloperComo prepararse y conseguir trabajo como Mobile Developer
Como prepararse y conseguir trabajo como Mobile Developer
Charlin Agramonte
 
Desarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin formsDesarrollando apps multi plataformas con xamarin forms
Desarrollando apps multi plataformas con xamarin forms
Charlin Agramonte
 
C#good practices in 10 minutes
C#good practices in 10 minutesC#good practices in 10 minutes
C#good practices in 10 minutes
Charlin Agramonte
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best Practices
Charlin Agramonte
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesome
Charlin Agramonte
 
Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero Prism in xamarin forms from zero to hero
Prism in xamarin forms from zero to hero
Charlin Agramonte
 
Xamarin forms from zero to hero
Xamarin forms from zero to heroXamarin forms from zero to hero
Xamarin forms from zero to hero
Charlin Agramonte
 
Ad

Recently uploaded (20)

Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 

Xamarin Workshop Noob to Master – Week 5

  • 1. XAMARIN FORMS NOOB TO MASTER By Rendy Del Rosario and Charlin Agramonte Week 5
  • 2. Objectives - Understand what is a Web service - Understand what is a REST API and how to use in Xamarin - Consume a real API in Xamarin
  • 3. Web Service A web service is a collection of open protocols and standards used for exchanging data between applications or systems. For transferring data it uses: - XML - JSON SOAP RESTFUL TYPES
  • 4. API (Application Programming Interface) Is a set of defined functions and methods for interfacing with the underlying operating system or another program or service running on the computer.
  • 6. What are REST services? REST (Representational State Transfer) is an architecture for creating distributed applications which is modeled around the HTTP specification
  • 7. Definition URL HTTP methods A media type for the data https://www.some_address.com/customers GET/POST/PUT/PATCH/DELETE JSON/ XML
  • 8. Rest operations - Get - Post - Put - Patch - Delete
  • 9. Rest operations: GET This operation is used to retrieve data from the web service. https://www.some_address.com/users/ https://www.some_address.com/users/5 https://www.some_address.com/users?id=5
  • 10. Rest operations: POST This operation is used to create a new item of data on the web service. https://www.some_address.com/users/5
  • 11. Rest operations: PUT This operation is used to update an item of data on the web service. https://www.some_address.com/users/5
  • 12. Rest operations: PATCH This operation is used to update an item of data on the web service by describing a set of instructions about how the item should be modified. https://www.some_address.com/users/5
  • 13. Rest operations: DELETE This operation is used to delete an item of data on the web service. https://www.some_address.com/users/5
  • 15. JSON JSON (JavaScript Object Notation) is a lightweight format that is used for data interchanging. It is based on a subset of JavaScript language (the way objects are built in JavaScript).
  • 16. HttpStatus The REST service sends an HTTP status code in the HttpResponseMessage.StatusCode property, to indicate whether the HTTP request succeeded or failed. The common responses for this operation are: 201 (CREATED) 400 (BAD REQUEST) 500 (SERVER ERROR) 404 (NOT FOUND)
  • 18. Security in REST - Security is ultimately decided by the service – the client can only conform to what the service allows - Should always prefer https to protect the data peer-to-peer
  • 20. Xamarin API Options HttpClient ServiceStack RestSharp Platform Specific Most common approach, built into .NET Full fledged 3rd party web services framework, has client PCL for consuming REST services Full 3rd party client library that supports file downloads, authentication, chunking, etc Native Platform Apis for networking calls
  • 21. HttpClient The HttpClient class is used to send and receive requests over HTTP. It provides functionality for sending HTTP requests and receiving HTTP responses from a URI identified resource. Each request is sent as an asynchronous operation.
  • 22. HttpClient - Get JsonConvert is a Json.NET class that can serialize and deserialize data from a JSON string or stream based on a specified Type
  • 24. HttpClient - Post/Put/Delete Must serialize body and include encoding and content type
  • 26. Let’s do it step by step 1-Create an Interface IApiService for your call definitions 2-Create a class ApiService to handle your requests and implement the previously created interface 3-Implement your request calls in your Api Service and define them in your Interface 4-Do your calls in your ViewModel 5-Show the data in your views
  • 28. INDIVIDUAL EXERCISE Using the Public API Create an app for get a RNC of a company TIME: 45 MINUTES
  • 29. IOS - NSAppTransportSecurity App Transport Security (ATS) enforces secure connections between internet resources (such as the app's back-end server) and your app.
  • 30. Mobile Networks Applications should always determine whether a network is available before starting a network operation
  • 31. INDIVIDUAL EXERCISE Add connectivity handler to your actual project TIME: 15 MINUTES
  • 32. Refit Refit is a library heavily inspired by Square's Retrofit library, and it turns your REST API into a live interface https://github.com/paulcbetts/refit
  • 33. Helpful tools for Json and Request Handlers - http://json2csharp.com/ - https://www.getpostman.com/docs/postman/launching_postman/navi gating_postman
  • 34. HOMEWORK PRACTICE Using the Public API for Weather Create an App to get the Weather of Santo Domingo, DR
  • 35. Recommended Lectures - Web Service https://developer.xamarin.com/guides/xamarin-forms/cloud-services/consuming/ - HttpClient in Xamarin Forms http://blog.xhackers.co/httpclient-with-xamarin-forms/ https://www.youtube.com/watch?v=xNP-K37mssA
  • 36. By Rendy Del Rosario and Charlin Agramonte Week 5 THANK YOU!!!