HttpClient-based Client Channel for Xamarin platforms (and other platforms supported via PCL)

Some platforms are supported only via PCL. Ungortunately some platform-level API’s are not available there. Still there is a way to use platform API’s and RO SDK or Data Abstract together.

This code snippet contains a full implementation of HttpClient-based client channel for Xamarin platform with proxy and basic authentication support.

Use scenario:
Main Xamarin app (iOS or Android one, I tested on both). It references
1.1. Data Access class library
1.2. Data Abstract for PCL build (or RemObjects SDK for PCL build of no Data Abstract features are needed) assemblies

In [1] that has both full access to the Xamarin platform framework implement the client channel. When the data access is performed instantiate the client channel, provide it to the DataModule class defined in the data access PCL library and finally access the data.

HttpClientChannel.cs (10.3 KB)

1 Like