andriydruk / bonjourbrowser Goto Github PK
View Code? Open in Web Editor NEWService Browser is a utility that discovers all services registered in a network
License: Apache License 2.0
Service Browser is a utility that discovers all services registered in a network
License: Apache License 2.0
The last release for play store was on June 2017. Is there any chance we can get a release with the fixes made since then?
W/art: Throwing OutOfMemoryError "Could not allocate JNI Env"
E/AndroidRuntime: FATAL EXCEPTION: Thread-15287
Process: com.livestream.mevo, PID: 31626
java.lang.OutOfMemoryError: Could not allocate JNI Env
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:1063)
at com.apple.dnssd.AppleQuery.<init>(DNSSD.java:844)
at com.apple.dnssd.AppleDNSSD._queryRecord(DNSSD.java:591)
at com.apple.dnssd.DNSSD.queryRecord(DNSSD.java:321)
at com.github.druk.rxdnssd.RxDnssdCommon$3$1$2.getService(RxDnssdCommon.java:108)
at com.github.druk.rxdnssd.RxDnssdBindable$DNSSDServiceAction.call(RxDnssdBindable.java:65)
at com.github.druk.rxdnssd.RxDnssdBindable$DNSSDServiceAction.call(RxDnssdBindable.java:51)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10150)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:250)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:147)
at rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.fastPath(OnSubscribeFromArray.java:76)
at rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.request(OnSubscribeFromArray.java:58)
at rx.Subscriber.setProducer(Subscriber.java:211)
at rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:32)
at rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:24)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10150)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:250)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:147)
at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
at rx.internal.operators.OperatorMerge$MergeSubscriber.emitLoop(OperatorMerge.java:732)
at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:437)
at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:357)
at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:852)
at rx.observers.Subscribers$5.onNext(Subscribers.java:235)
at com.github.druk.rxdnssd.RxResolveListener.serviceResolved(RxResolveListener.java:46)
at com.apple.dnssd.AppleService.ProcessResults(Native Method)
at com.apple.dnssd.AppleService.run(DNSSD.java:693)
at java.lang.Thread.run(Thread.java:818)
hello
Under what circumstances can a service not be found
Thank you for this demo and I just made my application work properly on my device.I want to give some suggestions no offence,when you are showing some functional project can we just make a simple UI?I know it's suggested to uses fragments instead of activties but is hard to analysize your core code.Again,my thanks!
Hi Andriy! I tried your app and it's working great. Maybe you can add the feature to register a service. Background: I use Unison in Terminal to sync files with my phone. I'd like to configure Unison to sync to hostname.local instead an IP address.
Just add a switch on the menu bar and advertise a _workstation._tcp service on 'hostname'.local like Avahi does.
03-22 13:51:44.325 30293 30293 D StrictMode: StrictMode policy violation; ~duration=180 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2
03-22 13:51:44.325 30293 30293 D StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1137)
03-22 13:51:44.325 30293 30293 D StrictMode: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:182)
03-22 13:51:44.325 30293 30293 D StrictMode: at libcore.io.IoUtils.canOpenReadOnly(IoUtils.java:165)
03-22 13:51:44.325 30293 30293 D StrictMode: at dalvik.system.DexPathList.findLibrary(DexPathList.java:383)
03-22 13:51:44.325 30293 30293 D StrictMode: at dalvik.system.BaseDexClassLoader.findLibrary(BaseDexClassLoader.java:77)
03-22 13:51:44.325 30293 30293 D StrictMode: at java.lang.Runtime.loadLibrary(Runtime.java:361)
03-22 13:51:44.325 30293 30293 D StrictMode: at java.lang.System.loadLibrary(System.java:988)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.github.druk.dnssd.AppleDNSSD._init(InternalDNSSD.java:552)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.github.druk.dnssd.InternalDNSSD.init(InternalDNSSD.java:91)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.github.druk.dnssd.DNSSD.<init>(DNSSD.java:79)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.github.druk.dnssd.DNSSD.<init>(DNSSD.java:75)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.github.druk.dnssd.DNSSDBindable.<init>(DNSSDBindable.java:32)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.github.druk.rxdnssd.RxDnssdBindable.<init>(RxDnssdBindable.java:32)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.druk.servicebrowser.BonjourApplication.createDnssd(BonjourApplication.java:100)
03-22 13:51:44.325 30293 30293 D StrictMode: at com.druk.servicebrowser.BonjourApplication.onCreate(BonjourApplication.java:59)
and if it finds services it takes a long time. Your app in the appstore finds services always immediately. What is the difference?
Since this is a FOSS app, it should also be on F-Droid.
Hello,
On iOS mDNS returns to user info when there are no more devices to discover/resolve. SO after this message user can stop discovery to save battery and etc.
Is there such option?
Check availability of daemon before choosing implementation of RxDNSSD
┆Issue is synchronized with this Asana task
I am having some trouble to get this library working on every Android 9 smartphone i have tested on. This problem is only occouring on Android 9 and the same code runs without any problem on all lower versions.
This is a small code snippet that i use currently to test the mDNS-Discovery:
var rxDnssd = RxDnssdBindable(context)
rxDnssd.browse("_https._tcp", "local.")
.compose(rxDnssd.resolve())
.compose(rxDnssd.queryRecords())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ Log.d("DNSSD", "foundService: $it" },
{ throwable -> Log.e("DNSSD", "error", throwable) })
When this code gets executed there are no corresponding debug or error messages in the logs.
I have not seen any api changes with Android 9 to why this should not work anymore and i am clueless at this point.
Any help with this is appreciated!
hi
implementation 'com.github.andriydruk:rx2dnssd:0.9.13'
****.apk!/lib/armeabi, /system/lib, /vendor/lib, /product/lib]]] couldn't find "libjdns_sd_embedded.so"
I tested your library on a wide range of devices and compared the results with https://play.google.com/store/apps/details?id=com.grokkt.android.bonjour
Only a crappy Samsung Galaxy Alpha with Android 4.4.2 did not show anything while at the same time the other app shows everything just fine. I got the following exception:
03-15 19:06:06.335 D/dalvikvm: Trying to load lib /data/app-lib/com.druk.bonjour.browser-1/libjdns_sd.so 0x42d7a7f0
03-15 19:06:06.345 D/dalvikvm: Added shared lib /data/app-lib/com.druk.bonjour.browser-1/libjdns_sd.so 0x42d7a7f0
03-15 19:06:06.345 D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com.druk.bonjour.browser-1/libjdns_sd.so 0x42d7a7f0, skipping init
E/DNSSD: Error:
com.apple.dnssd.AppleDNSSDException: DNS-SD Error -65563: SERVICENOTRUNNING
at com.apple.dnssd.AppleService.ThrowOnErr(DNSSD.java:652)
at com.apple.dnssd.AppleBrowser.<init>(DNSSD.java:704)
at com.apple.dnssd.AppleDNSSD._makeBrowser(DNSSD.java:557)
at com.apple.dnssd.DNSSD.browse(DNSSD.java:120)
at com.github.druk.rxdnssd.RxDnssd$1.getService(RxDnssd.java:72)
at com.github.druk.rxdnssd.RxDnssd$DNSSDServiceAction.call(RxDnssd.java:230)
at com.github.druk.rxdnssd.RxDnssd$DNSSDServiceAction.call(RxDnssd.java:216)
at rx.Observable$2.call(Observable.java:162)
at rx.Observable$2.call(Observable.java:154)
at rx.Observable.subscribe(Observable.java:8191)
at rx.Observable.subscribe(Observable.java:8158)
at rx.Observable.subscribe(Observable.java:7962)
at com.druk.bonjour.browser.ui.fragment.RegTypeBrowserFragment.startDiscovery(RegTypeBrowserFragment.java:74)
at com.druk.bonjour.browser.ui.fragment.ServiceBrowserFragment.onResume(ServiceBrowserFragment.java:126)
at android.support.v4.app.Fragment.performResume(Fragment.java:2020)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1107)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2056)
at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:196)
at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:505)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:494)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:161)
at android.app.Activity.performResume(Activity.java:5481)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2906)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2945)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2355)
at android.app.ActivityThread.access$800(ActivityThread.java:163)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
I'm pretty sure I did nothing wrong using your library because this app here has the same problem. I hope you have an idea what could be wrong.
2019-01-21 12:49:48.609 17222-17222/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.druk.servicebrowser, PID: 17222
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 45(offset:45).state:61
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5504)
at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:282)
at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:336)
at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:349)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:356)
at android.support.v7.widget.GapWorker.run(GapWorker.java:387)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
I have an avahid service configuration for a txt record that can be empty:
<txt-record value-format="binary-hex">fname=</txt-record>
In avahi-browse the field is shown:
txt = [... "fname=" ...]
In the BonjourBrowser the field is omitted if it is empty.
Is this a feature or a bug?
java.lang.RuntimeException: Unable to pause activity {com.druk.servicebrowser/com.druk.servicebrowser.ui.MainActivity}: java.util.ConcurrentModificationException
at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:3812)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3778)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3752)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4555)
at android.app.ActivityThread.-wrap19(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1515)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6286)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:851)
at java.util.HashMap$ValueIterator.next(HashMap.java:879)
at com.druk.servicebrowser.ui.fragment.RegTypeBrowserFragment.stopDiscovery(RegTypeBrowserFragment.java:91)
at com.druk.servicebrowser.ui.fragment.ServiceBrowserFragment.onPause(ServiceBrowserFragment.java:149)
at android.support.v4.app.Fragment.performPause(Fragment.java:2371)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1357)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchPause(FragmentManager.java:2920)
at android.support.v4.app.FragmentController.dispatchPause(FragmentController.java:234)
at android.support.v4.app.FragmentActivity.onPause(FragmentActivity.java:448)
at android.app.Activity.performPause(Activity.java:6912)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1315)
at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:3801)
... 11 more
Some routers has 5g wifi functions,BonjourBrowser performances perfectly under other circumstances but cannot find ipv4 address in 5gwifi.Also I've tried to convert ipv6 to ipv4 but I failed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.