0

I am building a Kotlin based Android App and I am using KOTR for the http client. I have it working correctly when pointing at a test server running on the internet.

However, to carry out more iterative development (and some R&D) I would much prefer to point at a local website that I have running on my machine. I can access this site via the browser no problem with http://mysite.local, I can also run Postman requests happily against the locally running api using requests starting http://mysite.local.

But when I use this for kotr requests running on an Android Emulator in Android Studio it gives me an error

Unable to resolve host "mysite.local": No address associated with hostname

I am aware of this question How to connect to my http://localhost web server from Android Emulator

So tried using 10.0.2.2, but got this error instead

communication to 10.0.2.2 not permitted by network security policy

I am using WAMP to run an apache server with several virtual hosts, so ideally I need a way to point the emulator at this.

Is there a way to do that and enable the emulator to see my virtual hosts?

I would have thought this was a common thing to want to do during Android development.

AntG
  • 1,259
  • 18
  • 28

0 Answers0