I am doing a project for several platforms, where I followed the best practices and created a main project containing all the code, which is the same on all platforms. To do network communication, I would like to use HttpClient, which seems to be the recommended method for exchanging information with web services in the future.
I DO NOT make a PCL, but just a standard C # library to contain the main project. However, it seems that there is no general implementation of HttpClient, but only for specific platforms. I cannot reference and use it in my kernel, but only in my Android and iOS projects.
I would really like to have all the network code in my main project, and as I see it, there are two options - none of which I like.
- Create a common interface that I can use in the main project, which is implemented as a shell on both Android and iOS.
- Use another technology that is supported in the main project - I think it is a web client or the like.
What is the recommended approach and why didnβt Hamarin make HttpClient available as a shared library?
Hope someone can help, Thanks
blackpool
source share