SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
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!!!

Más contenido relacionado

La actualidad más candente

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 clientSebastiano 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 XAMLQuang 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 2012daniel plocker
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flexJoseph Khan
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniIntroduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniJoseph Khan
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architectureRomain Rochegude
 
Beginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMBeginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMharprits10
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCAnton Krasnoshchok
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introductionBhagath Gopinath
 
Automated Testing on iOS
Automated Testing on iOSAutomated Testing on iOS
Automated Testing on iOSMake School
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application ArchitectureMake School
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpAmazon Web Services
 
Launching Services in Amazon Web Services
Launching Services in Amazon Web ServicesLaunching Services in Amazon Web Services
Launching Services in Amazon Web ServicesJames Armes
 
Intro to EmberJS
Intro to EmberJSIntro to EmberJS
Intro to EmberJSBilly 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 PluginSanjaya Prakash Pradhan
 
Active server pages
Active server pagesActive server pages
Active server pagesstudent
 

La actualidad más candente (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
 
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)
 
Lesson 02 Introduction to XAML
Lesson 02 Introduction to XAMLLesson 02 Introduction to XAML
Lesson 02 Introduction to XAML
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
 
Building Cool apps with flex
Building Cool apps with flexBuilding Cool apps with flex
Building Cool apps with flex
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - ZaloniIntroduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - Zaloni
 
iOS Swift application architecture
iOS Swift application architectureiOS Swift application architecture
iOS Swift application architecture
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Beginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMBeginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAM
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
Automated Testing on iOS
Automated Testing on iOSAutomated Testing on iOS
Automated Testing on iOS
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application Architecture
 
Angular introduction basic
Angular introduction basicAngular introduction basic
Angular introduction basic
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet Up
 
Launching Services in Amazon Web Services
Launching Services in Amazon Web ServicesLaunching Services in Amazon Web Services
Launching Services in Amazon Web Services
 
Intro to EmberJS
Intro to EmberJSIntro to EmberJS
Intro to EmberJS
 
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
 
Active server pages
Active server pagesActive server pages
Active server pages
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
 

Similar a Xamarin Workshop Noob to Master – Week 5

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.pptxkmani5
 
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).pptHusseinWassof
 
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 2015Jackson F. de A. Mafra
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swiftTim 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 DeveloperInnoTech
 
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 Patternsukdpe
 
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.pdfEngmohammedAlzared
 
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 APIsAparna 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 APIsKnoldus 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 SiteIRJET Journal
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 

Similar a 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
 
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
 
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
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
gofortution
gofortutiongofortution
gofortution
 
Web Service
Web ServiceWeb Service
Web Service
 
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
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
 
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
 
REST API
REST APIREST API
REST API
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
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
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
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
 
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
 
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
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 

Más de 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.NETCharlin 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 appsCharlin Agramonte
 
Integrando un rest api con refit
Integrando un rest api con refitIntegrando un rest api con refit
Integrando un rest api con refitCharlin 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 FormsCharlin Agramonte
 
Desenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDDesenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDCharlin 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 DeveloperCharlin 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 formsCharlin Agramonte
 
C#good practices in 10 minutes
C#good practices in 10 minutesC#good practices in 10 minutes
C#good practices in 10 minutesCharlin Agramonte
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best PracticesCharlin Agramonte
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesomeCharlin 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 heroCharlin Agramonte
 

Más de Charlin Agramonte (20)

State machine in .NET
State machine in .NETState machine in .NET
State machine in .NET
 
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
 
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
 
Integrando un rest api con refit
Integrando un rest api con refitIntegrando un rest api con refit
Integrando un rest api con refit
 
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
 
Desenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLIDDesenvolvendo Aplicações SOLID
Desenvolvendo Aplicações SOLID
 
Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms Mastering XAML in Xamarin Forms
Mastering XAML in Xamarin Forms
 
C# Good practices
C# Good practicesC# Good practices
C# Good practices
 
Starting my blog
Starting my blogStarting my blog
Starting my blog
 
C# Best Practices
C# Best PracticesC# Best Practices
C# Best Practices
 
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
 
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
 
C#good practices in 10 minutes
C#good practices in 10 minutesC#good practices in 10 minutes
C#good practices in 10 minutes
 
Xamarin Forms Best Practices
Xamarin Forms Best PracticesXamarin Forms Best Practices
Xamarin Forms Best Practices
 
Xamarin Forms Evolution
Xamarin Forms EvolutionXamarin Forms Evolution
Xamarin Forms Evolution
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesome
 
Visual studio 2019 launch
Visual studio 2019 launch Visual studio 2019 launch
Visual studio 2019 launch
 
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
 
Xamarin forms - overcloud
Xamarin forms - overcloudXamarin forms - overcloud
Xamarin forms - overcloud
 
Xamarin forms from zero to hero
Xamarin forms from zero to heroXamarin forms from zero to hero
Xamarin forms from zero to hero
 

Último

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Último (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

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!!!