Search code examples
androidasp.net-web-apixamarin.formsandroid-emulatorandroid-networking

how to get android emulator to connect to a specific port on our server


I am using Xamarin Forms to build an Android app. The data that the app will consume is stored on our server in a SQL database on our local network. I am using a C# Web API service (served by IIS) to connect the app to the server. All traffic will be inside our local network.

Currently the Web API is being served by IP address on port 90 - this was the only way I could get the emulator to be able to connect to the server, as no luck accessing it by name. I can fire up a browser on my development machine and load up http://10.1.1.15:90/api/Controller and I get back the data I was expecting.

I have also done a networkaccess check for access to 10.1.1.15 on port 90 using Powershell from my machine, which comes back Fine.

I use James Montemagno's Connectivity package to check for network access in the app - this returns true if I check for the IP address. It returns true if I check for the IP address on port 80. However it returns false if I check for the IP address on port 90. How can I get this to access the server on port 90? (BTW it will also need to access other services on port 91 and 92).


Solution

  • The android device was set up by default with a proxy. I toild it not to use the proxy and then it worked