How to connect to a REST web service on a local host using a phone as emulator?

I try to run the example "TodoREST". Because my processor doesn't support SLAT I cannot use an (Android) emulator so I use my phone in stead. When I run the projects the TodoApi output appears in the browser and the app runs on my phone. There is a call to the Task list but it returns an error saying that there is a connection timeout. When using an emulator I have to use to call the localhost. But I use a phone. Maybe this is different?


  • matrixlukanmatrixlukan Member ✭✭

    Step 1 :
    If your api is a c# project then you can bind your Urls to
    Change your Program.cs file to add Urls.

    return WebHost.CreateDefaultBuilder(args)

    Step 2 :
    Connect your android device to your servers network (recommended to connect via wifi).

    Step 3 :
    Find the IP address of the server by running the command ipconfig in command prompt.

    Step 4 :
    Replace with server's IP address in xamarin project.

Sign In or Register to comment.