So I'm struggling to get an API working on my Android device that goes to localhost on my computer.
I use Visual Studio 2017 and I'm currently only testing for Android (no iOS).
What does work: I have found my IP-address from my pc and the right port, so when I enter the API on chrome on my phone it works, I get the info I wanted from the API. What also works is Xamarin Live Player, when I use the IP from my laptop, it gives the info from the API in the app, but one big issue here is that I can't log anything in Xamarin Live Player, which is very difficult to debug.
What I want to work but doesn't: Whenever I run the app on my device it gives an "System.Net.Webexception: Connection refused". My firewall is off and as I said, I can use the API in chrome but something goes wrong when I want to use it with the app. Same goes for the emulators from Visual Studio.
So, what can I do to get the local api to work on my device en emulators?