Connection in android emulator for Socket application

KajKaj Member ✭✭
edited April 2018 in Xamarin.Android

Hello everyone.
I'm new to xamarin so take it easy with me.
I'm developing an application Client/Server using xamarin. The Server will be on android and the client will be desktop application.
I don't have a problem in the code, but I can't access the emulator ip address. I mean client cannot connect to server.
If I move the application to an android device with an IP address like 192.168.xx.xx , I have no problem in connection. But I can't achieve this in the emulator.
I tried the internal IP address of the Desktop ( Windows 10 ) with no luck.
The IP address of the emulator if I fire adb shell >> ipconfig return 10.0.2.15, I tried it with no luck. I tried also 10.0.2.2 with no success.
So what should I edit to get a real IP ( if it's possible ) or how to connect to that kind of IP ( the emulator IP ) ?

Running xamarin with visual studio community 2017, Windows 10 Home
Thank's in advanced

Best Answer

  • KajKaj ✭✭
    Accepted Answer

    Ok, I solved the problem by using Xamarin android player, then used the IP of the emulator which we can see in the settings. and the client connected directly to that IP address.

Answers

  • KajKaj Member ✭✭
    Accepted Answer

    Ok, I solved the problem by using Xamarin android player, then used the IP of the emulator which we can see in the settings. and the client connected directly to that IP address.

  • slapshotslapshot Member

    Hi, I am running into the same problem. Where exactly did you find the IP address in the settings?

Sign In or Register to comment.