Android VM - Connection Error

Asked

Viewed 198 times

3

Dear friends, good morning!

I’m not getting connection on my android emulator, could anyone help me? I’m using Visualstudio Emulator for Android.

My project is compiling, and running right, but I can’t connect, 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 device connection problem.

Below is code C#:

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; } }

Error in emulator:

inserir a descrição da imagem aqui

Settings of the VM: inserir a descrição da imagem aqui

Att. Felipe


Tiago S, do I need to change the gateway too? I did what you said, and I’m still not connected, take a look below:

inserir a descrição da imagem aqui

Thanks man!

Att. Felipe

  • Can access any other site through android emulator browser?

  • So dude, no. This error is generating when I try to access some site in the emulator browser.

  • Try to see if the Firewall is not blocking, deactivate and test.

  • I disabled the firewall here, and nothing either. Dude, do I need to leave only one of the adapters enabled? Like, leave only the internal, or the external? And if I leave only the internal, I need to share my network?

1 answer

0

I had the same problem.

The solution for me was to go into the settings of wifi of android and manually configure the network by 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;

  • You manually configured the wifi network? If that’s it, for me it’s no use, I have no wifi here, I need to configure the local network. In case I got it wrong, disregard haha

  • Emulator wifi network, inside it...

  • A yes! So, here would not work. I need to configure the local network..

  • I don’t understand your problem now...rsrs but follows the way for you to access the settings wifi Settings>Wifi>Modify network. I am using the emulator with the Lollipop and to appear the option of Modify network I need to keep tight

  • This way I know. The problem here, is that I do not have Wifi, I need the local network, be shared with that of my virtual machine. I am connected in wired network, not in Wifi, why I said it would not work haha

  • I understood, you do not need to have wifi in your local machine. You need to make changes to the virtual machine (Emulator), there is wifi. Here I didn’t have to do anything in the local machine

  • It helped me.

  • Ata! Got it Tiago! Dude, I’ll try here, after lunch I’ll answer to you, thanks for the tip!

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.