android-nsd

Android : Stopping a Bonjour service left running after the parent process quit abrubtly

一笑奈何 提交于 2019-12-30 08:49:07
问题 My app is essentially a background service that needs to occasionally register an NSD service ( Bonjour service) for the purpose of enabling discovery of a socket server run by the main background service (aka run by the app). If I am reading the Android Bonjour Service doc correctly, this is how you start the Bonjour service (abbreviated for conciseness): mNsdManager = Context.getSystemService(Context.NSD_SERVICE); mDiscoveryListener = new NsdManager.DiscoveryListener() mNsdManager

Android - jmdns doesn't discover devices

若如初见. 提交于 2019-12-12 07:09:22
问题 I'm trying to implement a class to discover services on the network. I've tried working with Android's NSD and it does discover the services fine, but it supports only API levels 16 and up, and I can't seem to retrieve the txtRecord field within the service info (it returns null for some reason). Turns out it's a known problem... So now I'm trying to work with jmDNS, which doesn't seem to find services at all. here's my class (I'm working with the AndroidAnnotations framework) MDnsHelper:

getSystemService(Context.NSD_SERVICE) freezes the 5.0 emulator

非 Y 不嫁゛ 提交于 2019-12-10 10:54:52
问题 Trying to execute the following line NsdManager Mgr = (NsdManager)Ctxt.getSystemService(Context.NSD_SERVICE); in the Android 5.0 emulator (ARMv7a, on Win64) freezes the emulator. The debugger never reaches the next line, the emulator doesn't respond to buttons, can be only closed. Tried from both a background thread and from the main one. The context is an Activity. Permissions in the manifest include: android.permission.INTERNET android.permission.ACCESS_WIFI_STATE android.permission.CHANGE

Nsd Manager Android Crashing on 4.2.2

时光毁灭记忆、已成空白 提交于 2019-12-08 18:09:24
问题 Discovering services results in a system crash. The type of discover I am trying is "_http._tcp." Here's the log. D/NsdService(13310): Discover services E/AndroidRuntime(13310): *** FATAL EXCEPTION IN SYSTEM PROCESS: NsdService E/AndroidRuntime(13310): java.lang.NullPointerException E/AndroidRuntime(13310): at com.android.server.NsdService$ClientInfo.access$1200(NsdService.java:801) E/AndroidRuntime(13310): at com.android.server.NsdService$NsdStateMachine$EnabledState.requestLimitReached

NSD Device Lost Message Not Received on Disabling Wifi

旧城冷巷雨未停 提交于 2019-12-06 07:16:32
问题 I have written a sample app using NSD as explained here. The app works fine, it discovers services, resolve services and also report services lost if that service is unregistered. But in a user scenario like: If NSD app is running on a device named A and has registered a service on A while few other devices named B , C , D are listening to this service. service is discovered by B , C , D - expected behavior now wifi is switched off an device A . I am expecting to receive a service lost

NsdManager doesn't stop service discovery

拜拜、爱过 提交于 2019-12-04 16:07:47
问题 In Android app that I'm currently developing, I want to connect do zero-config networks using NsdManager . I managed to run network service discovery and connect to the desired network, but after stopping discovery NsdManager thread is still running. This leads to the situation when after a few screen rotations there are many NsdManager threads that are browsing for a connection. When any network is available, device tries to synchronize many times, so every NsdManager is still active,

NSD Device Lost Message Not Received on Disabling Wifi

蓝咒 提交于 2019-12-04 13:51:01
I have written a sample app using NSD as explained here . The app works fine, it discovers services, resolve services and also report services lost if that service is unregistered. But in a user scenario like: If NSD app is running on a device named A and has registered a service on A while few other devices named B , C , D are listening to this service. service is discovered by B , C , D - expected behavior now wifi is switched off an device A . I am expecting to receive a service lost message on devices B , C , D , but I am not getting it? If I do not switch off wifi on A , but just close