Skip to Main Content
Xamarin.Forms Projects
book

Xamarin.Forms Projects

by Johan Karlsson, Daniel Hindrikes
December 2018
Intermediate to advanced content levelIntermediate to advanced
416 pages
10h 30m
English
Packt Publishing
Content preview from Xamarin.Forms Projects

Creating the chat service

The first thing we will do is create a chat service that will be used by both the iOS and Android applications. To make the code more testable and to make it easier to replace the chat service if we want to use another provider in the future, we will follow these steps:

  1. In the Chat project, add a reference to the Chat.Messages project.
  2. Create a new folder in the Chat project called Services.
  3. Create a new interface called IChatService in the Services folder.
  4. Create a bool property called IsConnected.
  5. Create a method called SendMessage that takes Message as an argument and returns Task.
  6. Create a method called CreateConnection that returns Task. The method will create and start a connection to the SignalR service. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Xamarin.Forms Projects - Second Edition

Xamarin.Forms Projects - Second Edition

Daniel Hindrikes, Johan Karlsson
Xamarin Blueprints

Xamarin Blueprints

Michael Williams
Xamarin.Forms Solutions

Xamarin.Forms Solutions

Gerald Versluis, Steven Thewissen

Publisher Resources

ISBN: 9781789537505Supplemental Content