Device discovery in local network

前端 未结 2 741
情深已故
情深已故 2021-01-18 06:07

I\'m currently developing an android app using SDK >= 16 which should be able to discover different android devices (later also iOS devices) in a local area network using th

相关标签:
2条回答
  • 2021-01-18 07:04

    Check out http://developer.android.com/training/connect-devices-wirelessly/index.html It mentions two ways of finding local services- NSD and wifi direct.

    0 讨论(0)
  • 2021-01-18 07:07

    Check my answer in very similar question Android Network Discovery Service (ish) before API 14

    I do not belive that multicast is not working on Galaxy S2, some time ago when I was coding some network application, I made several test on many devices, some older like G1 but also on S2, S3 and Galaxy Tab 10.

    But to be able to use multicast you must enable it programatically.

    Have you used this piece of code?

    WifiManager wifi = (WifiManager)getSystemService( Context.WIFI_SERVICE );
    if(wifi != null){
    WifiManager.MulticastLock lock = wifi.createMulticastLock("Log_Tag");
    lock.acquire();
    }
    
    0 讨论(0)
提交回复
热议问题