Reputation: 8630
I've managed to use the following guide for enabling my VS2015 Android Emulator access to a ASP.NET WEP API running on my local-host which is great :-
But i would also like to configure my Xamarin application for enabling my external android device the same access to the web api.
At present, when running from device, the webclient makes the request but it never completes, which leaves the application hanging.
Does anyone know how I can achieve this?
Upvotes: 3
Views: 4187
Reputation: 384
Check your applicationhost.config, find the bindings for your WebApi. There should be something like this:
<binding protocol="http" bindingInformation="*:<your-port>:localhost" />
Add a binding for external requests:
<binding protocol="http" bindingInformation="*:<your-port>:*" />
Then your device can make requests to
<your-network-IP-of-your-machine>:<your-port>
Your device and your machine hosting the WebApi needs to be in the same network, e.g. your local WiFi.
Upvotes: 1