nsd

How to find all available services using Android's native Network Service Discovery

北城以北 提交于 2019-12-04 06:31:45
I've read through android documentation on finding specific network services using NSD. Below is my code to discover all the available _http._tcp services. final NsdManager.DiscoveryListener discoveryListener = new NsdManager.DiscoveryListener() { @Override public void onDiscoveryStarted(String s) { Log.i(TAG, "onDiscoveryStarted: " + s); } @Override public void onServiceFound(NsdServiceInfo nsdServiceInfo) { Log.i(TAG, "onServiceFound: " + nsdServiceInfo.toString()); } @Override public void onServiceLost(NsdServiceInfo nsdServiceInfo) { Log.i(TAG, "onServiceLost: " + nsdServiceInfo.toString()

Android, NSD/DNS-SD: NsdManager unreliable discovery and IP resolution

♀尐吖头ヾ 提交于 2019-12-03 12:21:32
问题 In the course of the last weeks, Android's NSD implementation is making me go mad: From a user's point of view, the following problems arise: Devices discover each other in a completely non-deterministic fashion. If I launch my NsdManager -based app, it works more or less if only two devices are involved. If a third device joins, it will seldomly discover the first two , and the first two will not see the third. If I exit the apps (they gracefully unregister the NSD listeners) and restart

Android, NSD/DNS-SD: NsdManager unreliable discovery and IP resolution

断了今生、忘了曾经 提交于 2019-12-03 01:53:17
In the course of the last weeks, Android's NSD implementation is making me go mad: From a user's point of view, the following problems arise: Devices discover each other in a completely non-deterministic fashion. If I launch my NsdManager -based app, it works more or less if only two devices are involved. If a third device joins, it will seldomly discover the first two , and the first two will not see the third. If I exit the apps (they gracefully unregister the NSD listeners) and restart them in a different order, the discovery pattern is not exactly the same, but similar. In my home network,

How do I get host names by using IP, MAC addresses in android

纵饮孤独 提交于 2019-12-02 09:37:35
问题 I need to get the details of all wireless devices that are connected to my wifi network. I'm getting IP, MAC addresses, somehow Vendors of device as well. How do I get the device type? (i.e laptop, mobile, AC, Refrigerator) And host names? InetAddress inetAddress = null; for (int i = 0; i < 256; i++) { try { inetAddress = InetAddress.getByName("192.168.1." + i); if (inetAddress.isReachable(30)) { ConnectedDevice device = new ConnectedDevice(); device.setDeviceIPAddress(subnet + i); device

NSdManager ResolveListener Error Code 3: Failure Already active

风格不统一 提交于 2019-12-01 13:34:31
问题 I'm using NsdManager in an Android App to discover NSD services published by another device also developed by me. I only do service discovery on Android App (no service registration needed on this side). There are several instances of the same type of service published at the same time on the network. I started using the sample code provided by Google (https://developer.android.com/training/connect-devices-wirelessly/nsd) but I had fatal errors due to reusing the same resolver object at the

How to scan IP and Mac address of all Device Connected to wifi in android accurately?

你。 提交于 2019-11-30 12:56:11
Hi i am trying to find all devices connected to My WIFI Router from android and ,i need to device Mac address and local ip address of each device (Including iOT Devices) , right now , i am trying to find from ARP cache table . but sometime in the scan some devices are missing , it is not so accurate . My Code : List<LocalDeviceInfo> devicesInfos = new ArrayList<>(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader("/proc/net/arp")); String line; while ((line = bufferedReader.readLine()) != null) { String[] splitted = line.split(" +"); if (splitted

How to scan IP and Mac address of all Device Connected to wifi in android accurately?

可紊 提交于 2019-11-29 18:17:34
问题 Hi i am trying to find all devices connected to My WIFI Router from android and ,i need to device Mac address and local ip address of each device (Including iOT Devices) , right now , i am trying to find from ARP cache table . but sometime in the scan some devices are missing , it is not so accurate . My Code : List<LocalDeviceInfo> devicesInfos = new ArrayList<>(); BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new FileReader("/proc/net/arp")); String line;