Android VM - Connection Error

3

Dear, good morning!

I am not getting connection in my android emulator, could someone help me? I'm using VisualStudio Emulator for Android.

My project is compiling, and running correctly, but I can not connect, do I need to configure something in Hyper-V?

The error happens when I try to connect to some web service, so I imagine it is a device connection problem.

Below is C # code:

public static async Task<List<Model.Livros>> GetAsync() { using (var client = new HttpClient()) { var json = await client.GetStringAsync("http://mvalivros.azurewebsites.net/api/livros"); var livros = JsonConvert.DeserializeObject<List<Model.Livros>>(json); return livros; } }

Emulator error:

VMSettings:

Att.Felipe

JamesS,doIneedtochangethegatewaytoo?Ididwhatyousaid,andI'mstillwithoutaconnection,takealookbelow:

Thanks a lot!

Att. Felipe

    
asked by anonymous 28.04.2016 / 14:17

1 answer

0

I had the same problem.

The solution for me was to go in the settings of wifi of android and manually configure the network, changing the IP settings as Static and the IP address being that of my machine but adding 1 at the end. ex:

  

My machine : 192.168.0.5;

     

Android : 192.168.0.51;

    
29.04.2016 / 15:55