1

I have been writing my app to connect to network shares on the lan, this all works fine using user and password, but if I want to just discover devices on the network I cannot find any devices using the emulator, if I install the app on my android phone then I can discover devices!

I have tried this with SharpCifs.Std and RSSDP, they both give the same result, So I am assuming its something to do with the emulator.

My question is...Are there any settings that need to be set to allow the discovery of devices on an emulator?

Mark
  • 85
  • 9
  • Do you set the DNS address like your host?You can use `getprop` to check it in the adb shell, for example. If the DNS address of your host is 192.168.1.1, first of get the root permission by `adb root`, then Use `setprop net.eth0.dns1 192.168.1.1` – Leon Mar 24 '20 at 06:14
  • @Leon, Thank you for your reply, where can I run these commands? in the command window when the device is running? – Mark Mar 24 '20 at 11:29
  • Ok after a bit of searching I found it, [Here](https://stackoverflow.com/questions/21099301/android-adb-commands-to-get-the-device-properties) the commands you give are correct but with the difference that it needs 'adb shell' as the first param so it would be adb shell getprop/setprop. thank you for your guidance, I will test the setup and I will let you know it it solves my problem. – Mark Mar 24 '20 at 12:14
  • 1
    Update...Until now, I managed to change the dns and gw, however...on the wireless device of the emulator, the ip address remains that given buy the internal router of the emulator and obviously the app still cannot see any devices on the lan. For now I have resorted to using the usb connection and a samsung device, this I find to be actually much better for the sake of design, because one can set the layout boundaries in developer mode. It would be nice to actually have the emulator running on my lan for further testing, but I suppose I will get back to it at a later time. Again thank you! – Mark Mar 25 '20 at 12:59
  • I'm trying to use the NsdManager and discover a service hosted on a physical device with the app I'm building and running on an emulator. Did you ever find out how you can get a device on the local networked to be discoverable by your emulator? – Mark Bath Feb 28 '21 at 01:15

0 Answers0