Coder Social home page Coder Social logo

andriydruk / rxdnssd Goto Github PK

View Code? Open in Web Editor NEW
294.0 21.0 74.0 1.53 MB

Android version of mDNSResponder

License: Apache License 2.0

Java 8.72% Shell 0.06% Makefile 0.86% C 88.25% Python 0.29% C++ 0.98% Roff 0.82%
android android-library bonjour dnssd dnssd-library browse-services mdnsresponder register-service hacktoberfest

rxdnssd's Introduction

THE PROJECT IS ARCHIVED DUE TO THE RUSSIAN INVASION OF UKRAINE

πŸ‡ΊπŸ‡¦ #StandWithUkraine

On Feb. 24, 2022 Russia declared an unprovoked war on Ukraine and launched a full-scale invasion. Russia is currently bombing peaceful Ukrainian cities, including schools and hospitals and attacking civilians who are fleeing conflict zones.

Please support Ukraine by lobbying your governments, protesting peacefully, and donating money to support the people of Ukraine. Below are links to trustworthy organizations that are helping to defend Ukraine in this unprovoked war:

Android mDNSResponder Circle CI Download Download Download

Why I created this library?

My explanation about why jmDNS, Android NSD Services and Google Nearby API are not good enough, and why I maintain this library.

Hierarchy

There are two version of mDNSReposder.

Bindable version:

                                   +--------------------+       +--------------------+
                                   |      RxDNSSD       |       |       Rx2DNSSD     |
                                   +--------------------+       +--------------------+
                                           |                            |
                                           |   +--------------------+   |
                                            -->| Android Java DNSSD |<--
                                               +--------------------+
                                               |  Apple Java DNSSD  |
                 +------------------+          +--------------------+
                 |    daemon.c      |<-------->|     mDNS Client    |
                 +------------------+          +--------------------+
                 |    mDNS Core     |
                 +------------------+
                 | Platform Support |
                 +------------------+
                    System process                Your Android app

Embedded version:

                     +--------------------+       +--------------------+
                     |      RxDNSSD       |       |       Rx2DNSSD     |
                     +--------------------+       +--------------------+
                                |                            |
                                |   +--------------------+   |
                                 -->| Android Java DNSSD |<--
                                    +--------------------+
                                    |   Apple Java DNSSD |    
                                    +--------------------+
                                    |    mDNS Client     |
                                    +--------------------+
                                    | Embedded mDNS Core |
                                    +--------------------+
                                    | Platform Support   |
                                    +--------------------+
                                      Your Android app

Binaries on MavenCentral

DNSSD library:

compile 'com.github.andriydruk:dnssd:0.9.17'

RxDNSSD library:

compile 'com.github.andriydruk:rxdnssd:0.9.17'

Rx2DNSSD library:

compile 'com.github.andriydruk:rx2dnssd:0.9.17'
  • It's built with Andorid NDK 21 for all platforms (1.7 MB). If you prefer another NDK version or subset of platforms, please build it from source with command:
./gradlew clean build

How to use

DNSSD

Dnssd library provides two implementations of DNSSD interface:

DNSSDBindable is an implementation of DNSSD with system's daemon. Use it for Android project with min API higher than 4.1 for an economy of battery consumption (Also some Samsung devices can don't work with this implementation).

[Update] Since targetSDK = 31 (Android 12) system's deamon was deprecated by Google. Consider switching to an Embedded version or some other solution.

DNSSD dnssd = new DNSSDBindable(context); 

DNSSDEmbedded is an implementation of RxDnssd with embedded DNS-SD core. Can be used for any Android device with min API higher than Android 4.0.

DNSSD dnssd = new DNSSDEmbedded(); 
Register service
try {
	registerService = dnssd.register("service_name", "_rxdnssd._tcp", 123,  
   		new RegisterListener() {

			@Override
			public void serviceRegistered(DNSSDRegistration registration, int flags, 
				String serviceName, String regType, String domain) {
				Log.i("TAG", "Register successfully ");
			}

			@Override
         	public void operationFailed(DNSSDService service, int errorCode) {
				Log.e("TAG", "error " + errorCode);
        	}
   		});
} catch (DNSSDException e) {
	Log.e("TAG", "error", e);
}
Browse services example
try {
	browseService = dnssd.browse("_rxdnssd._tcp", new BrowseListener() {
                
 		@Override
		public void serviceFound(DNSSDService browser, int flags, int ifIndex, 
			final String serviceName, String regType, String domain) {
			Log.i("TAG", "Found " + serviceName);
		}

		@Override
		public void serviceLost(DNSSDService browser, int flags, int ifIndex, 
			String serviceName, String regType, String domain) {
			Log.i("TAG", "Lost " + serviceName);
		}

		@Override
		public void operationFailed(DNSSDService service, int errorCode) {
			Log.e("TAG", "error: " + errorCode);
		}        
	});
} catch (DNSSDException e) {
	Log.e("TAG", "error", e);
}

You can find more samples in app inside this repository.

RxDNSSD

  • RxDnssdBindable
RxDnssd rxdnssd = new RxDnssdBindable(context); 
  • RxDnssdEmbedded
RxDnssd rxdnssd = new RxDnssdEmbedded(); 
Register service
BonjourService bs = new BonjourService.Builder(0, 0, Build.DEVICE, "_rxdnssd._tcp", null).port(123).build();
Subscription subscription = rxdnssd.register(bonjourService)
      .observeOn(AndroidSchedulers.mainThread())
      .subscribe(service -> {
      		updateUi();
      }, throwable -> {
        	Log.e("DNSSD", "Error: ", throwable);
      });
Browse services example
Subscription subscription = rxDnssd.browse("_http._tcp", "local.")
	.compose(rxDnssd.resolve())
    .compose(rxDnssd.queryRecords())
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new Action1<BonjourService>() {
    	@Override
        public void call(BonjourService bonjourService) {
        	Log.d("TAG", bonjourService.toString());
        }
    }, new Action1<Throwable>() {
        @Override
        public void call(Throwable throwable) {
        	Log.e("TAG", "error", throwable);
        }
	});

Rx2DNSSD

  • Rx2DnssdBindable
Rx2Dnssd rxdnssd = new Rx2DnssdBindable(context); 
  • Rx2DnssdEmbedded
Rx2Dnssd rxdnssd = new Rx2DnssdEmbedded(); 
Register service
BonjourService bs = new BonjourService.Builder(0, 0, Build.DEVICE, "_rxdnssd._tcp", null).port(123).build();
registerDisposable = rxDnssd.register(bs)
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(bonjourService -> {
            Log.i("TAG", "Register successfully " + bonjourService.toString());
        }, throwable -> {
            Log.e("TAG", "error", throwable);
        });
Browse services example
browseDisposable = rxDnssd.browse("_http._tcp", "local.")
        .compose(rxDnssd.resolve())
        .compose(rxDnssd.queryRecords())
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(bonjourService -> {
            Log.d("TAG", bonjourService.toString());
            if (bonjourService.isLost()) {
                mServiceAdapter.remove(bonjourService);
            } else {
                mServiceAdapter.add(bonjourService);
            }
        }, throwable -> Log.e("TAG", "error", throwable));

License

Copyright (C) 2022 Andriy Druk

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

rxdnssd's People

Contributors

andriydruk avatar dependabot-preview[bot] avatar lancechentw avatar mannodermaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rxdnssd's Issues

Check Not Null DMX Conflict

I was trying to compile for Android -4.4 and I got a DMX File Conflict for the Java Annotations for CheckNotNull file class.

Error on running app:
:app:transformClassesWithDexForDebug Ljavax/annotation/CheckForNull;

I had to add the following to compile successfully:
compile ('com.github.andriydruk:rxdnssd:0.9.1') {
exclude group : 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs', module: 'annotations'
}

java 8 support issue

Hi,
i tried to import 'com.github.andriydruk:rxdnssd:0.9.7' but get the following error while compiling:

Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.functions.Func1
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.Observable$Transformer
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.functions.Func1
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.Observable$Transformer
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.functions.Func1
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.functions.Func1
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.Observable$Transformer
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are rx.Observable$Transformer
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception

i'm setting targetCompatibility = '1.8' in my code for other dependency.

Wrong txtRecord format will crash app.

java.lang.ArrayIndexOutOfBoundsException: src.length=38 srcPos=3 dst.length=103 dstPos=0 length=103
                                                                         at java.lang.System.arraycopy(Native Method)
                                                                         at com.apple.dnssd.TXTRecord.getValue(TXTRecord.java:219)
                                                                         at com.apple.dnssd.TXTRecord.getValueAsString(TXTRecord.java:230)
                                                                         at com.github.druk.rxdnssd.RxResolveListener.parseTXTRecords(RxResolveListener.java:57)
                                                                         at com.github.druk.rxdnssd.RxResolveListener.serviceResolved(RxResolveListener.java:42)
                                                                         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)

Do you have any idea about this?

Loss of service discovery

This is not a bug report. We find this api is working fine from a small footprint. There is one question related to Bonjour in general: What is best practice for discovering loss of services? In an embedded system of dedicated services, I need to discover loss of service as fast as possible. Does this imply a need to run a rediscovery on suitable intervals (10sec or so), or is there a setting to manipulate in order to achieve something similar?

Java support

Hi,

is there any plan to support this library on linux using Java openJDK. it will add a lot of value

IpV6 support

Can we tell me what is the status regarding ipv6?

Native crash on Samsung using DnsEmbedded

11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: can't call void com.github.druk.rxdnssd.RxResolveListener.serviceResolved(com.apple.dnssd.DNSSDService, int, int, byte[], byte[], int, com.apple.dnssd.TXTRecord) on null object
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]     in call to CallVoidMethod
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]     from int com.apple.dnssd.DNSSDEmbedded.Loop()
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410] "DNS-SD" prio=10 tid=59 Runnable
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   | group="main" sCount=0 dsCount=0 obj=0x13391160 self=0x7f754d1a00
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   | sysTid=7031 nice=-8 cgrp=default sched=0/0 handle=0x7f2f8ff440
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 129673111 21079655 153 ) utm=3 stm=9 core=2 HZ=100
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   | stack=0x7f2f7fd000-0x7f2f7ff000 stackSize=1037KB
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   native: #00 pc 000000000048be10  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+200)
11-07 11:09:38.949 3962-7031/com.mycompany.myapp A/art: art/runtime/java_vm_ext.cc:410]   native: #01 pc 000000000045abc0  /system/lib64/libart.s

ProGuard rules

ProGuard rules for saving classes that work with native

compiling issues

Hi,

I'm not able to use this library due to the following errors while compiling:

ABIs [arm64-v8a,armeabi-v7a,armeabi] set by 'android.injected.build.abi' gradle flag contained 'ARMEABI' not targeted by this project.	
com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Ebrahim\.gradle\caches\transforms-1\files-1.1\dnssd-0.9.10.aar\1332ccdf813c7a344339362a48c9531f\jars\classes.jar
com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.	
com.android.tools.r8.CompilationFailedException: Compilation failed to complete	
com.android.tools.r8.utils.AbortException: Error: Invoke-customs are only supported starting with Android O (--min-api 26)

my gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.2'
    defaultConfig {
        applicationId "com.app.player"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        externalNativeBuild {
            ndkBuild {
                def gstRoot

                if (project.hasProperty('gstAndroidRoot'))
                    gstRoot = project.gstAndroidRoot
                else
                    gstRoot = System.env.GSTREAMER_ROOT_ANDROID

                if (gstRoot == null)
                    throw new GradleException('GSTREAMER_ROOT_ANDROID must be set, or "gstAndroidRoot" must be defined in your gradle.properties in the top level directory of the unpacked universal GStreamer Android binaries')

				arguments "NDK_APPLICATION_MK=src/main/jni/Application.mk",
                        "GSTREAMER_JAVA_SRC_DIR=src/main/java",
                        "GSTREAMER_ROOT_ANDROID=$gstRoot",
                        "GSTREAMER_ASSETS_DIR=src/main/assets"

                targets "player"

                abiFilters 'armeabi-v7a', 'arm64-v8a'
            }
        }

        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        ndkBuild {
            path 'src/main/jni/Android.mk'
        }
    }
}

repositories {
    google()
}

afterEvaluate {
    compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug'
    compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease'
}

dependencies {
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'com.google.firebase:firebase-messaging:17.3.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support:support-v13:28.0.0-rc02'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:gridlayout-v7:28.0.0-rc02'
    implementation 'com.android.support:cardview-v7:28.0.0-rc02'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.jcraft:jsch:0.1.54'
    api 'com.github.andriydruk:rxdnssd:0.9.10'
    implementation 'org.jmdns:jmdns:3.5.4'
    implementation 'org.slf4j:slf4j-api:1.7.25'
}

apply plugin: 'com.google.gms.google-services'

OutOfMemoryError

Like I wrote yesterday, I updated RxDNSSD to 0.9.3 (mainly because I hoped the following issue may been fixed) but I still get this error after a while and my app freezes. Normally this error appears when I do nothing within the app. Seems like it occurs in some background progress.

Maybe you have an idea?

11-22 13:53:21.117  W/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Out of memory"
11-22 13:53:21.118  W/System.err: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Out of memory
11-22 13:53:21.118  W/System.err:     at java.lang.Thread.nativeCreate(Native Method)
11-22 13:53:21.119  W/System.err:     at java.lang.Thread.start(Thread.java:1078)
11-22 13:53:21.119  W/System.err:     at com.github.druk.dnssd.AppleQuery.<init>(InternalDNSSD.java:846)
11-22 13:53:21.119  W/System.err:     at com.github.druk.dnssd.AppleDNSSD._queryRecord(InternalDNSSD.java:593)
11-22 13:53:21.119  W/System.err:     at com.github.druk.dnssd.InternalDNSSD.queryRecord(InternalDNSSD.java:323)
11-22 13:53:21.119  W/System.err:     at com.github.druk.dnssd.DNSSD.queryRecord(DNSSD.java:411)
11-22 13:53:21.119  W/System.err:     at com.github.druk.rxdnssd.RxDnssdCommon$3$1$2.getService(RxDnssdCommon.java:113)
11-22 13:53:21.119  W/System.err:     at com.github.druk.rxdnssd.RxDnssdCommon$DNSSDServiceAction.call(RxDnssdCommon.java:214)
11-22 13:53:21.119  W/System.err:     at com.github.druk.rxdnssd.RxDnssdCommon$DNSSDServiceAction.call(RxDnssdCommon.java:201)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
11-22 13:53:21.119  W/System.err:     at rx.Observable.unsafeSubscribe(Observable.java:10256)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:148)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.fastPath(OnSubscribeFromArray.java:76)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeFromArray$FromArrayProducer.request(OnSubscribeFromArray.java:58)
11-22 13:53:21.119  W/System.err:     at rx.Subscriber.setProducer(Subscriber.java:211)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:32)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeFromArray.call(OnSubscribeFromArray.java:24)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
11-22 13:53:21.119  W/System.err:     at rx.Observable.unsafeSubscribe(Observable.java:10256)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:148)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:395)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:355)
11-22 13:53:21.119  W/System.err:     at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:846)
11-22 13:53:21.119  W/System.err:     at rx.observers.Subscribers$5.onNext(Subscribers.java:235)
11-22 13:53:21.119  W/System.err:     at com.github.druk.rxdnssd.RxResolveListener.serviceResolved(RxResolveListener.java:40)
11-22 13:53:21.119  W/System.err:     at com.github.druk.dnssd.DNSSD$2$1.run(DNSSD.java:232)
11-22 13:53:21.119  W/System.err:     at android.os.Handler.handleCallback(Handler.java:743)
11-22 13:53:21.119  W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
11-22 13:53:21.119  W/System.err:     at android.os.Looper.loop(Looper.java:150)
11-22 13:53:21.119  W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5659)
11-22 13:53:21.119  W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
11-22 13:53:21.119  W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:822)
11-22 13:53:21.119  W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)```

Native crash 'stack corruption detected' from AppleService_BlockForData

Happens quite frequently. Any ideas?

Fatal signal 6 (SIGABRT), code -6 in tid 9398 (Thread-2205)
 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 Build fingerprint: 'asus/WW_P00A/P00A_2:6.0/MRA58K/WW_P00A-V4.7.0-20161216:user/release-keys'
 Revision: '0'
 ABI: 'arm64'
 pid: 6724, tid: 9398, name: Thread-2205  >>> xxx <<<
 signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
 Abort message: 'stack corruption detected'
     x0   0000000000000000  x1   00000000000024b6  x2   0000000000000006  x3   0000000000000000
     x4   0000000000000000  x5   0000000000000001  x6   0000000000000000  x7   0000000000000000
     x8   0000000000000083  x9   647362647364631f  x10  7f7f7f7f7f7f7f7f  x11  0101010101010101
     x12  0000007f8bb5f888  x13  44fc4f1ec2750d19  x14  44fc4f1ec2750d19  x15  0035bebe59be2020
     x16  0000007f8bb59570  x17  0000007f8baeb5fc  x18  0000007efd1ed9d8  x19  0000007efd1ee500
     x20  0000007efd1ee440  x21  0000000000000000  x22  0000000000000006  x23  0000007efd1ee1f8
     x24  0000007efd1ee2a8  x25  0000007efd1ee2c8  x26  0000000000000004  x27  00000000703e58b0
     x28  0000007f0542d6c0  x29  0000007efd1edd20  x30  0000007f8bae8f78
     sp   0000007efd1edd20  pc   0000007f8baeb604  pstate 0000000020000000
 
 backtrace:
     #00 pc 000000000006a604  /system/lib64/libc.so (tgkill+8)
     #01 pc 0000000000067f74  /system/lib64/libc.so (pthread_kill+68)
     #02 pc 00000000000239f8  /system/lib64/libc.so (raise+28)
     #03 pc 000000000001e198  /system/lib64/libc.so (abort+60)
     #04 pc 00000000000215e0  /system/lib64/libc.so (__libc_fatal+128)
     #05 pc 0000000000069728  /system/lib64/libc.so (__stack_chk_fail+16)
     #06 pc 000000000000625c  /data/app/xxx-2/lib/arm64/libjdns_sd.so (Java_com_apple_dnssd_AppleService_BlockForData+288)
     #07 pc 00000000022227fc  /data/app/xxx-2/oat/arm64/base.odex (offset 0x1030000) (int com.apple.dnssd.AppleService.BlockForData()+128)
     #08 pc 0000000002222bcc  /data/app/xxx-2/oat/arm64/base.odex (offset 0x1030000) (void com.apple.dnssd.AppleService.run()+64)
     #09 pc 00000000023da0f4  /system/framework/arm64/boot.oat (offset 0x23af000)

Discovery doesn't work with Android 9

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!

Process UTF-8 error.

I saw this log on Android Logcat monitor.
It seems Apple library's error. Can we avoid that?

07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0x5c
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]     string: 'οΏ½\011.local.'
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]     in call to NewStringUTF
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]     from int com.apple.dnssd.AppleService.ProcessResults()
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65] "Thread-4536" prio=5 tid=19 Runnable
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x130560e0 self=0x9f61c400
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | sysTid=12468 nice=-11 cgrp=apps sched=0/0 handle=0x9f630080
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | state=R schedstat=( 1027083 0 1 ) utm=0 stm=0 core=2 HZ=100
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | stack=0x9f3fa000-0x9f3fc000 stackSize=1036KB
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #00 pc 00004640  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #01 pc 00002e8d  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #02 pc 00248069  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #03 pc 0022c9f3  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #04 pc 000b1873  /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #05 pc 000b1fad  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #06 pc 000b4407  /system/lib/libart.so (art::ScopedCheck::Check(bool, char const*, ...) (.constprop.128)+882)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #07 pc 000bce71  /system/lib/libart.so (art::CheckJNI::NewStringUTF(_JNIEnv*, char const*)+36)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #08 pc 00004915  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (???)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #09 pc 00002961  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (???)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #10 pc 000031c5  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (DNSServiceProcessResult+308)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #11 pc 00004e89  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (Java_com_apple_dnssd_AppleService_ProcessResults+152)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #12 pc 002d7d8b  /data/dalvik-cache/arm/data@[email protected]@[email protected] (Java_com_apple_dnssd_AppleService_ProcessResults__+82)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   at com.apple.dnssd.AppleService.ProcessResults(Native method)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   at com.apple.dnssd.AppleService.run(DNSSD.java:693)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   - locked <0x256d48d0> (a com.apple.dnssd.AppleResolver)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   at java.lang.Thread.run(Thread.java:818)
07-15 16:21:47.139 12420-12468/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65] 
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0x5c
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]     string: 'οΏ½\011.local.'
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]     in call to NewStringUTF
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]     from int com.apple.dnssd.AppleService.ProcessResults()
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65] "Thread-4538" prio=5 tid=21 Runnable
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x13065080 self=0xaf14b800
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | sysTid=12470 nice=-11 cgrp=apps sched=0/0 handle=0xaf15ad00
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | state=R schedstat=( 653594 271614 3 ) utm=0 stm=0 core=0 HZ=100
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | stack=0x9f1f2000-0x9f1f4000 stackSize=1036KB
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #00 pc 00004640  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #01 pc 00002e8d  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #02 pc 00248069  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #03 pc 0022c9f3  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+146)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #04 pc 000b1873  /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #05 pc 000b1fad  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #06 pc 000b4407  /system/lib/libart.so (art::ScopedCheck::Check(bool, char const*, ...) (.constprop.128)+882)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #07 pc 000bce71  /system/lib/libart.so (art::CheckJNI::NewStringUTF(_JNIEnv*, char const*)+36)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #08 pc 00004915  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (???)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #09 pc 00002961  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (???)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #10 pc 000031c5  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (DNSServiceProcessResult+308)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #11 pc 00004e89  /data/app/com.hitachi.smartac-1/lib/arm/libjdns_sd.so (Java_com_apple_dnssd_AppleService_ProcessResults+152)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   native: #12 pc 002d7d8b  /data/dalvik-cache/arm/data@[email protected]@[email protected] (Java_com_apple_dnssd_AppleService_ProcessResults__+82)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   at com.apple.dnssd.AppleService.ProcessResults(Native method)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   at com.apple.dnssd.AppleService.run(DNSSD.java:693)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   - locked <0x1c9790c9> (a com.apple.dnssd.AppleResolver)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65]   at java.lang.Thread.run(Thread.java:818)
07-15 16:21:47.139 12420-12470/com.hitachi.smartac A/art: art/runtime/check_jni.cc:65] 
07-15 16:21:47.159 12420-12468/com.hitachi.smartac A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6f0068b2 in tid 12468 (Thread-4536)

JNI crash

I got two kind of jni crash when use this lib, and here is the crash stack

1Β #00 pc 000051de /data/app/com.cvte.androidrender-1/lib/arm/libjdns_sd.so (Java_com_apple_dnssd_AppleService_BlockForData+97) [armeabi-v7a]
--
2Β #01 pc 0025ba37 /data/dalvik-cache/arm/data@[email protected]@[email protected] (oatdata+2468407) [armeabi]
3Β java:
4Β com.apple.dnssd.AppleService.void run()(DNSSD.java:688)
5Β java.lang.Thread.run(Thread.java:818)
1Β #00 pc 00021fc0 /system/lib/libc.so (tgkill+12) [armeabi-v7a]
--
2Β #01 pc 0001307d /system/lib/libc.so (pthread_kill+48) [armeabi-v7a]
3Β #02 pc 00013291 /system/lib/libc.so (raise+10) [armeabi-v7a]
4Β #03 pc 00011fa9 /system/lib/libc.so [armeabi-v7a]
5Β #04 pc 00021874 /system/lib/libc.so (abort+4) [armeabi-v7a]
6Β #05 pc 00045bdb /system/lib/libdvm.so (dvmAbort+78) [armeabi-v7a]
7Β #06 pc 00049381 /system/lib/libdvm.so [armeabi-v7a]
8Β #07 pc 0004b24f /system/lib/libdvm.so [armeabi-v7a]
9Β #08 pc 0000638d /data/app-lib/com.cvte.androidrender-2/libjdns_sd.so [armeabi-v7a]
10Β #09 pc 000039c1 /data/app-lib/com.cvte.androidrender-2/libjdns_sd.so [armeabi-v7a]
11Β #10 pc 00002b8b /data/app-lib/com.cvte.androidrender-2/libjdns_sd.so (DNSServiceProcessResult+602) [armeabi-v7a]
12Β #11 pc 000052bd /data/app-lib/com.cvte.androidrender-2/libjdns_sd.so (Java_com_apple_dnssd_AppleService_ProcessResults+140) [armeabi-v7a]
13Β #12 pc 0001db8c /system/lib/libdvm.so (dvmPlatformInvoke+112) [armeabi-v7a]
14Β #13 pc 0004e033 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398) [armeabi-v7a]
15Β #14 pc 00026fa0 /system/lib/libdvm.so [armeabi-v7a]
16Β #15 pc 0002df2c /system/lib/libdvm.so (dvmMterpStd(Thread*)+76) [armeabi-v7a]
17Β #16 pc 0002b5d8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) [armeabi-v7a]
18Β #17 pc 0006045f /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+338) [armeabi-v7a]
19Β #18 pc 00060483 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20) [armeabi-v7a]
20Β #19 pc 00055173 /system/lib/libdvm.so [armeabi-v7a]
21Β #20 pc 0000d208 /system/lib/libc.so (__thread_entry+72) [armeabi-v7a]
22Β #21 pc 0000d3a4 /system/lib/libc.so (pthread_create+240) [armeabi-v7a]
23Β java:
24Β com.apple.dnssd.AppleService.int ProcessResults()(Native Method)
25Β com.apple.dnssd.AppleService.void run()(DNSSD.java:693)
26Β java.lang.Thread.run(Thread.java:841)

Which one to use for android mDNS alternative?

Hello,
I found 2 projects:
andriydruk/BonjourBrowser
andriydruk/RxDNSSD

Both show mDNS messages in the network.
Wich one is better to use as replacement of mDNS provided by Android OS?
Thanks in advance!

discovery of Bonjour services continues after browseService.stop() is called

Not sure if this is a problem in my code.
I start a service from my activity to discover devices that broadcast their services (in my case SERVICE_TYPE = "_arduino._tcp.";).
In onStartCommand() of the service I do

@Override
public int onStartCommand( Intent intent, int flags, int startId ) {
	mHandler = new Handler(Looper.getMainLooper());
	dnssd = new DNSSDBindable(this);
	try {
		browseService = dnssd.browse("_arduino._tcp.", new BrowseListener() {
			@Override
			public void serviceFound(DNSSDService browser, int flags, int ifIndex,
									 final String serviceName, final String regType, final String domain) {
				try {
					dnssd.resolve(flags, ifIndex, serviceName, regType, domain, new ResolveListener() {
						@Override
						public void serviceResolved(DNSSDService resolver, int flags, int ifIndex,
													String fullName, final String hostName, final int port,
													final Map<String, String> txtRecord) {
							try {
								QueryListener listener = new QueryListener() {
									@Override
									public void queryAnswered(DNSSDService query, final int flags, final int ifIndex,
															  final String fullName, int resolveClass, int resolveType,
															  final InetAddress address, int ttl) {
										if (BuildConfig.DEBUG) Log.d(DEBUG_LOG_TAG, "Query address " + fullName);
										queryLooper = new Runnable() {
											@Override
											public void run() {
												BonjourService.Builder builder =
														new BonjourService.Builder(flags, ifIndex, serviceName,
																regType, domain)
																.dnsRecords(txtRecord)
																.port(port)
																.hostname(hostName);
												// Do something with the resolve results
											}
										};
										mHandler.post(queryLooper);
									}

									@Override
									public void operationFailed(DNSSDService service, int errorCode) {}
								};
								dnssd.queryRecord(0, ifIndex, hostName, 1, 1, listener);
								dnssd.queryRecord(0, ifIndex, hostName, 28, 1, listener);
							} catch (DNSSDException e) {e.printStackTrace();}
						}

						@Override
						public void operationFailed(DNSSDService service, int errorCode) {}
					});
				} catch (DNSSDException e) {e.printStackTrace();}
			}

			@Override
			public void serviceLost(DNSSDService browser, int flags, int ifIndex,
									String serviceName, String regType, String domain) {
			}

			@Override
			public void operationFailed(DNSSDService service, int errorCode) {
			}
		});
	} catch (DNSSDException e) {
		if (BuildConfig.DEBUG) Log.d(DEBUG_LOG_TAG, "error", e);
	}

	// Start a countdown to stop the service after 15 seconds
	if (timer != null) {
		timer.cancel();
		timer = null;
	}
	timer = new CountDownTimer(15000, 1000) {
		public void onTick(long millisUntilFinished) {
			//Nothing here!
		}

		public void onFinish() {
			mHandler.removeCallbacksAndMessages(null);
			mHandler.removeCallbacks(null);
			browseService.stop();
			sendMyBroadcast(); 
			timer.cancel();
			timer = null;
			if (BuildConfig.DEBUG) Log.d(DEBUG_LOG_TAG, "NSDDevices - Discovery finished!");
			stopSelf();
		}
	};
	timer.start();

	return super.onStartCommand( intent, flags, startId );
}

I stop the service discovery after 15 seconds (No need to have it running all the time).
But even after browseService.stop(); I can see debug message Query address xxx.local. in the log file.
How do I properly stop the discovery?

Can't find device on an enterprise network

Hi, I am using this library in my Android project. It works ok at home, one device can find another without any problems. It is fast an reliable. The problem is when I try in the office where I work, or the university. These networks are more complex (obviously). In this case, the device that looks for the services, can find nothing. I wait a while, but nothing comes up. I guess that either some ports are blocked or firewall configuration is blocking something, who knows. I don't have access to any info about the infrastructure. My question is, is there any workaround that can help me with this issue? Or is there an alternative to this library that might work in a different way and might not cause this problem?

Thanks.

Issue when starting Release APK (not in debug/staging)

After compiling the app and installing it on the Android Emulator 6.0 it crashes with the following error on startup:

java.lang.InternalError: cannot instantiate DNSSDjava.lang.ClassNotFoundException: com.github.druk.dnssd.AppleDNSSD
                                                                           at com.b.a.a.h.<clinit>(Unknown Source)
                                                                           at com.b.a.a.b.<init>(Unknown Source)
                                                                           at com.b.a.a.b.<init>(Unknown Source)
                                                                           at com.b.a.a.c.<init>(Unknown Source)
                                                                           at com.yourock.digitaltv.coordinator.CoordinatorService.<clinit>(Unknown Source)
                                                                           at java.lang.Class.newInstance(Native Method)
                                                                           at android.app.ActivityThread.handleCreateService(ActivityThread.java:2859)
                                                                           at android.app.ActivityThread.-wrap4(ActivityThread.java)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                           at android.os.Looper.loop(Looper.java:148)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

This is the implementation settings at gradle:

    implementation 'com.github.andriydruk:dnssd:0.9.5'
    implementation('com.github.andriydruk:rxdnssd:0.9.5')
    implementation 'io.reactivex:rxjava:1.3.0'
    implementation 'io.reactivex:rxandroid:1.2.1'

In proguard rules I had the following which I removed:

# Removing references to RxDnssd
# -dontwarn com.github.druk.**

I guess it is falling into this piece of code being null?

String name = System.getProperty( "com.github.druk.dnssd.DNSSD" );

Observe that this just happens when I compile for Release. It is working ok for other releases. These are my proguard rules:

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/alissongodoi/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)
-keep class com.fasterxml.jackson.databind.ObjectMapper {
    public <methods>;
    protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
    public ** writeValueAsString(**);
}
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.**

#Proguard for okio
-dontwarn okhttp3.*
-dontwarn okio.**

#ProGuard for EventBus
-keepattributes *Annotation*
-keepclassmembers class ** {
    @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

#Configuration for jodatime
#-keep class org.joda.** { *; }
-dontwarn org.joda.convert.FromString
-dontwarn org.joda.convert.ToString

# Removing references to RxDnssd
-dontwarn com.github.druk.**

#Retrofit ProGuard
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

# Retrofit Retan Classes that are Models
-keep class com.yourock.digitaltv.model.** { *; }

Rx2DnssdEmbedded browse has time limit?

The browsing stop automatically in about 25 minutes and I could not receive BonjourService any more but if restart the app...
test on the Android 6.0.1 device

Port info is always zero after a service is published

Just wondering why the port information is returned 0 when the publication of a service is successful?

Rx2Dnssd rxdnssd = new Rx2DnssdEmbedded(); 
BonjourService bs = new BonjourService.Builder(0, 0, Build.DEVICE, "_rxdnssd._tcp", null).port(123).build();
registerDisposable = rxDnssd.register(bs)
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(bonjourService -> {
            Log.i("TAG", "Register successfully " + bonjourService.toString());
        }, throwable -> {
            Log.e("TAG", "error", throwable);
        });

TxtRecord changed can not trigger BonjourSerivce information update

Is there any way to refresh the BonjourService's information when the device has changed txtRecord itself? Can it become automatically in this library?

You can just ignore this problem if this is because Apple's mDnsResponder doesn't support.
I am OK with that.

Right now, my work-around is unsubscribe then resubscribe again.

Question: Why does `DNSSDBindable` grab `Context.NSD_SERVICE` without using it?

Hi,

I'm looking into your code. Specifically, in DNSSDBindable::onServiceStarting(), you get the Android NSD service via context.getSystemService(Context.NSD_SERVICE). However, it doesn't seem to be used.

My question is, why grab it in the first place? Also, does that mean DNSSDBindable is using the Android NsdManager service underneath?

Thanks in advance.

Is there any timeout operation when browse()?

I did my bonjour search with

rxDnssd.browse("_easylink._tcp.", "local.")
            .takeUntil(Observable.timer(5, TimeUnit.SECONDS))
            .compose(rxDnssd.resolve())
            .compose(rxDnssd.queryRecords())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(...);

And I expect that the onCompleted' of rxDnssd emitted after 5 seconds, but the result is wired. If there are nothing found during browse, i.e, no onNext(...) emitted, theonCompleted' is emitted after 5 seconds, but if there are any 'onNext' emitted during the 5 seconds, There is no `onCompleted'.

Create Rx version of DNSServiceReconfirmRecord

Could you please check this question(https://stackoverflow.com/questions/45987212/nsd-manager-keeps-old-service-in-memory-even-when-they-are-not-on-the-network-a) on Stack Overflow

Here is Example of calling DNSServiceReconfirmRecord on IOS https://developer.apple.com/library/archive/documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/ResolvingServices.html
image

It's not recommended, but there are some situations where I need to do this

Is there any way you can implement this feature?

Please contact me. Thank you

[email protected]

crash on call to NewByteArray

when i call the discovery method multiple times then i got this crash on JNI method:
A/art: art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: thread Thread[63,tid=22000,Native,Thread*=0x7f85f45e00,peer=0x12df10d0,"DNS-SD"] using JNIEnv* from thread Thread[63,tid=22000,Native,Thread*=0x7f85f45e00,peer=0x12df10d0,"DNS-SD"] A/art: art/runtime/java_vm_ext.cc:470] in call to NewByteArray A/art: art/runtime/java_vm_ext.cc:470] from int com.github.druk.dnssd.DNSSDEmbedded.nativeLoop() A/art: art/runtime/java_vm_ext.cc:470] "DNS-SD" daemon prio=10 tid=63 Runnable A/art: art/runtime/java_vm_ext.cc:470] | group="main" sCount=0 dsCount=0 obj=0x12df10d0 self=0x7f85f45e00 A/art: art/runtime/java_vm_ext.cc:470] | sysTid=22000 nice=-8 cgrp=default sched=0/0 handle=0x7f801ff450 A/art: art/runtime/java_vm_ext.cc:470] | state=R schedstat=( 14498181 7960363 30 ) utm=0 stm=1 core=4 HZ=100 A/art: art/runtime/java_vm_ext.cc:470] | stack=0x7f800fd000-0x7f800ff000 stackSize=1037KB A/art: art/runtime/java_vm_ext.cc:470] | held mutexes= "mutator lock"(shared held) A/art: art/runtime/java_vm_ext.cc:470] native: #00 pc 000000000047a0a0 /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220) A/art: art/runtime/java_vm_ext.cc:470] native: #01 pc 000000000047a09c /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+216) A/art: art/runtime/java_vm_ext.cc:470] native: #02 pc 000000000044e6ac /system/lib64/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+472) A/art: art/runtime/java_vm_ext.cc:470] native: #03 pc 00000000002eea0c /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1128) A/art: art/runtime/java_vm_ext.cc:470] native: #04 pc 00000000002ef0f4 /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+120) A/art: art/runtime/java_vm_ext.cc:470] native: #05 pc 0000000000102474 /system/lib64/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+156) A/art: art/runtime/java_vm_ext.cc:470] native: #06 pc 0000000000101d10 /system/lib64/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+172) A/art: art/runtime/java_vm_ext.cc:470] native: #07 pc 00000000000ff9bc /system/lib64/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+1120) A/art: art/runtime/java_vm_ext.cc:470] native: #08 pc 0000000000109264 /system/lib64/libart.so (_ZN3art8CheckJNI17NewPrimitiveArrayEPKcP7_JNIEnviNS_9Primitive4TypeE+636) A/art: art/runtime/java_vm_ext.cc:470] native: #09 pc 0000000000047a98 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #10 pc 0000000000031d68 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #11 pc 0000000000005b30 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #12 pc 000000000000fedc /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #13 pc 0000000000011750 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #14 pc 000000000002f6d0 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #15 pc 000000000002f4e8 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #16 pc 000000000002faa8 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #17 pc 000000000003d6b0 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #18 pc 000000000003d7d8 /data/app/com.weicantimes.weican.intl-2/lib/arm64/libjdns_sd_embedded.so (???) A/art: art/runtime/java_vm_ext.cc:470] native: #19 pc 00000000000dbb10 /system/lib64/libart.so (art_quick_generic_jni_trampoline+144) A/art: art/runtime/java_vm_ext.cc:470] native: #20 pc 00000000000d27e8 /system/lib64/libart.so (art_quick_invoke_static_stub+600) A/art: art/runtime/java_vm_ext.cc:470] native: #21 pc 00000000000df230 /system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+252) A/art: art/runtime/java_vm_ext.cc:470] native: #22 pc 000000000028eefc /system/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+312) A/art: art/runtime/java_vm_ext.cc:470] native: #23 pc 0000000000287ed8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+592) A/art: art/runtime/java_vm_ext.cc:470] native: #24 pc 0000000000555d90 /system/lib64/libart.so (MterpInvokeStatic+356) A/art: art/runtime/java_vm_ext.cc:470] native: #25 pc 00000000000c5094 /system/lib64/libart.so (ExecuteMterpImpl+14612) A/art: art/runtime/java_vm_ext.cc:470] at com.github.druk.dnssd.DNSSDEmbedded.nativeLoop(Native method) A/art: art/runtime/java_vm_ext.cc:470] at com.github.druk.dnssd.DNSSDEmbedded$1.run(DNSSDEmbedded.java:87) A/art: art/runtime/java_vm_ext.cc:470]

here is my code snippet:

JNI ERROR (app bug): local reference table overflow

Hello,

I am using the RxDnssdEmbedded version of the library, and sometimes I receive this error!
when I use the RxDnssdBindable version, I don't receive any error.
I am testing it on Nexus 5

05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115] JNI ERROR (app bug): local reference table overflow (max=512)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115] local reference table dump:
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]   Last 10 entries (of 512):
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       511: 0x132b4ad0 byte[] (4 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       510: 0x132d0ac0 byte[] (16 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       509: 0x132d06e0 byte[] (16 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       508: 0x132b47d0 byte[] (4 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       507: 0x132d0380 byte[] (16 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       506: 0x132b3f60 byte[] (16 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       505: 0x132b44d0 byte[] (4 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       504: 0x132b3c00 byte[] (16 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       503: 0x132b3820 byte[] (16 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       502: 0x132b41d0 byte[] (4 elements)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]   Summary:
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       117 of com.apple.dnssd.TXTRecord (117 unique instances)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]         1 of com.apple.dnssd.DNSSDEmbedded$1
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       117 of java.lang.Class (1 unique instances)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]        98 of byte[] (4 elements) (98 unique instances)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115]       179 of byte[] (16 elements) (179 unique instances)
05-26 12:56:04.456 19969-22022/com.breez.breezandroid A/art: art/runtime/indirect_reference_table.cc:115] 
05-26 12:56:04.951 19969-22022/com.breez.breezandroid A/art: art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
05-26 12:56:04.951 19969-22022/com.breez.breezandroid A/art: art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
05-26 12:56:04.952 19969-22022/com.breez.breezandroid A/art: art/runtime/runtime.cc:366] 
05-26 12:56:04.952 19969-22022/com.breez.breezandroid A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 22022 (DNS-SD)

mDNS discovery starts very slow.

Hello,
Discovery starts very slow on Samsung Galaxy S8 (Android 8.0).
On BonjourBrowser app discovery is started with RxDnssdBindable.
Switched to RxDnssdEmbedded and started quick.
Not sure if this fixed problem because meanwhile I restarted phone.

Currently discovery is with RxDnssdEmbedded. Will wait feedback from testers.
Do you have feedback from for other Samsung users with Android 8.0?

Best regards

0.9.11 crashing

After upgrading to 0.9.11 yesterday I saw two new crashes, that go away after reverting back to 0.9.10:

W/System.err: io.reactivex.exceptions.UndeliverableException: java.lang.RuntimeException: MulticastLock under-locked com.github.druk.dnssd.DNSSD
W/System.err:     at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableDoFinally$DoFinallySubscriber.runFinally(FlowableDoFinally.java:149)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableDoFinally$DoFinallySubscriber.onComplete(FlowableDoFinally.java:96)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableCreate$BaseEmitter.complete(FlowableCreate.java:267)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.drain(FlowableCreate.java:543)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableCreate$BufferAsyncEmitter.onComplete(FlowableCreate.java:498)
W/System.err:     at com.github.druk.rx2dnssd.Rx2QueryListener.queryAnswered(Rx2QueryListener.java:59)
W/System.err:     at com.github.druk.dnssd.DNSSD$4.lambda$queryAnswered$0$DNSSD$4(DNSSD.java:423)
W/System.err:     at com.github.druk.dnssd.DNSSD$4$$Lambda$0.run(Unknown Source:18)
W/System.err:     at android.os.Handler.handleCallback(Handler.java:790)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err:     at android.os.Looper.loop(Looper.java:164)

and

W/System.err: io.reactivex.exceptions.UndeliverableException: java.lang.RuntimeException: MulticastLock under-locked com.github.druk.dnssd.DNSSD
W/System.err:     at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableDoFinally$DoFinallySubscriber.runFinally(FlowableDoFinally.java:149)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableDoFinally$DoFinallySubscriber.cancel(FlowableDoFinally.java:102)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.cancel(FlowableFlatMap.java:353)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.cancel(FlowableFlatMap.java:353)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionHelper.cancel(SubscriptionHelper.java:189)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.cancel(FlowableSubscribeOn.java:141)
W/System.err:     at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.cancel(FlowableObserveOn.java:154)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionArbiter.drainLoop(SubscriptionArbiter.java:218)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionArbiter.drain(SubscriptionArbiter.java:187)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionArbiter.cancel(SubscriptionArbiter.java:179)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionArbiter.drainLoop(SubscriptionArbiter.java:218)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionArbiter.drain(SubscriptionArbiter.java:187)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionArbiter.cancel(SubscriptionArbiter.java:179)
W/System.err:     at io.reactivex.internal.subscriptions.SubscriptionHelper.cancel(SubscriptionHelper.java:189)
W/System.err:     at io.reactivex.internal.subscribers.LambdaSubscriber.cancel(LambdaSubscriber.java:119)
W/System.err:     at io.reactivex.internal.subscribers.LambdaSubscriber.dispose(LambdaSubscriber.java:104)
W/System.err:     at io.reactivex.disposables.CompositeDisposable.dispose(CompositeDisposable.java:235)
W/System.err:     at io.reactivex.disposables.CompositeDisposable.dispose(CompositeDisposable.java:80)

Changing to AP mode while in app makes DNSSDBindable not find any service

While using an app with DNSSDBindable I found different behavior when the device was in AP mode.

  • If the app was opened after the AP mode was enabled the search worked correctly
  • If the app was already opened when AP mode was enabled the search did not work

I'm recreating the DNSSDBindable before each search.

Invoke-customs are only supported starting with Android O (--min-api 26)

I got this error when I try to implement
'com.github.andriydruk:dnssd:0.9.7' and
"com.github.andriydruk:rxdnssd:0.9.7"
library on "min api:19 and target api:26" app:

Android issue:
Invoke-customs are only supported starting with Android O (--min-api 26)
Message{kind=ERROR, text=Invoke-customs are only supported starting with Android O (--min-api 26), sources=[Unknown source file], tool name=Optional.of(D8)}

Java compile:
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process
/home/.../.gradle/caches/transforms-1/files-1.1/dnssd-
0.9.7.aar/da29e81bbce2608f3cdc2603f6618baf/jars/classes.jar
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Caused by: com.android.tools.r8.utils.AbortException

So I implement v0.9.1 both.

queryRecord on type 16 never answers nor fails

Hiya,
Using version 0.9.7 of the DNSSD library, calling to queryrecord() never answers nor fails for type 16 (TXT record).
Works perfectly fine with type 1 or 28, and resolve is able to display the initial value for TXT record.
Tested on a Samsung Galaxy S7 with Android 7.0

Steps to reproduce

Service is published using dns-sd:
dns-sd -U
or
dns-sd -R Toto _testupdate._tcp . 1337 [foo=bar]

Monitored using:
dns-sd -Q Test._testupdate._tcp.local 16 1

Query for records after browsing and resolving:
dnssd.queryRecord(0, ifIndex, hostName, 1, 1, listener);
dnssd.queryRecord(0, ifIndex, hostName, 16, 1, listener);
dnssd.queryRecord(0, ifIndex, hostName, 28, 1, listener);

Service is found, resolved, queries for types 1 & 28 are answered, but not for type 16

04-12 18:10:00.436 30004-30004/com.xxx.zeroconf D/TAG: Found Toto _testupdate._tcp. local.
04-12 18:10:00.440 30004-30004/com.xxx.zeroconf D/TAG: Resolved NEO-L183.local.
04-12 18:10:00.441 30004-30004/com.xxx.zeroconf D/TAG: Toto._testupdate._tcp.local. NEO-L183.local. 1337
04-12 18:10:00.441 30004-30004/com.xxx.zeroconf D/TAG: TXT RECORD [foo bar]
04-12 18:10:00.449 30004-30004/com.xxx.zeroconf D/TAG: queryAnswered - rrtype 1 rrclss 1 - fullName NEO-L183.local. address /192.168.1.105
04-12 18:10:00.450 30004-30004/com.xxx.zeroconf D/TAG: queryAnswered - rrtype 28 rrclss 1 - fullName NEO-L183.local. address /[replaced_for_confidentiality]

OutOfMemoryError "Could not allocate JNI Env"

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)

┆Issue is synchronized with this Asana task

DexArchiveMergerException Unable to merge dex

After upgrading from 0.9.1 to 0.9.3 (no other changes made) I had to additionally add the rxjava dependency to my build.gradle because the rx.Subscription package was unknown.

But now my build fails with an DexArchiveMergerException:
Duplicate zip entry [61.jar:rx/annotations/Experimental.class]

Not sure but I guess changing rxjava implementation to api in your rxdnssd/build.gradle may fix the problem in my case.

PS: I also use RxJava2 in this project, but it's perfectly working side by side with 0.9.1.

com.apple.dnssd.AppleDNSSDException: DNS-SD Error -65563: SERVICENOTRUNNING

Hi,

First of all, I would like to thank you for creating such a nice library for the community to workaround most of the bonjour problems. This is really helpful for applications.

Coming back to the scenario, which I faced and would like to highlight is in your Application AndroidManifest, you haven't specified INTERNET permission and it is instead present in the Library manifest.
For example look here.

I think this is real scenario where people try to use this project to check the feasibility and later just integrate the library with their code. You should also highlight adding INTERNET permission AndroidManifest of application

If also you can reply to the stackoverflow thread

Regards,
Gurtaj

Segmentation fault

Hi,

as the title says I'm getting a segmentation fault. However this seems to be bound to some constraints (device, OS, network). I also found that the bug occurred on a certain wifi but not on other wifis (with the same device). But I cannot pin it down exactly since the mdns entries look fine (when analysing via Bonjour browser).

The segfault occurs on:

  • Samsung P5210 (Android 4.4.2)
  • Nexus 5 (Android 4.4.4)

The segfault does not occur on:

  • Nexus 9 (Android 6)
  • Nexus 10 (Android 5.1.1)
  • Nexus 5 (Android 6, Android 5.0.1)

Here is a log from the Nexus 5 (Android 4.4.4), where the actual package name is replaced with $package$ (for obvious reasons). I hope this helps to track it down. Also this happened both in RxDnssdBindable and RxDnssdEmbedded mode.

10-17 11:08:15.032 A/libc: Fatal signal 11 (SIGSEGV) at 0x1d20001e (code=1), thread 6649 (DNS-SD)
10-17 11:08:15.132 I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-17 11:08:15.132 I/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:4.4.4/KTU84P/1227136:user/release-keys'
10-17 11:08:15.132 I/DEBUG: Revision: '11'
10-17 11:08:15.132 I/DEBUG: pid: 6612, tid: 6649, name: DNS-SD  >>> $package$ <<<
10-17 11:08:15.132 I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 1d20001e
10-17 11:08:15.182 I/DEBUG:     r0 401561c8  r1 1da00015  r2 1d20001f  r3 00000000
10-17 11:08:15.182 I/DEBUG:     r4 1da00015  r5 00000078  r6 415a070f  r7 7789f030
10-17 11:08:15.182 I/DEBUG:     r8 1dc00011  r9 77c6d5e8  sl 4159ed8d  fp 00000000
10-17 11:08:15.182 I/DEBUG:     ip 7758a790  sp 7789efe8  lr 75484ba9  pc 1d20001e  cpsr 200a0030
10-17 11:08:15.182 I/DEBUG:     d0  0000000000000000  d1  0000000000000000
10-17 11:08:15.182 I/DEBUG:     d2  0000000000000000  d3  0000000000000000
10-17 11:08:15.182 I/DEBUG:     d4  000001d3447415e8  d5  000001d24473ff60
10-17 11:08:15.182 I/DEBUG:     d6  000001d24473ff48  d7  000001d244741b18
10-17 11:08:15.182 I/DEBUG:     d8  0000000000000000  d9  0000000000000000
10-17 11:08:15.182 I/DEBUG:     d10 0000000000000000  d11 0000000000000000
10-17 11:08:15.182 I/DEBUG:     d12 0000000000000000  d13 0000000000000000
10-17 11:08:15.182 I/DEBUG:     d14 0000000000000000  d15 0000000000000000
10-17 11:08:15.182 I/DEBUG:     d16 4045000000000000  d17 4045400000000000
10-17 11:08:15.182 I/DEBUG:     d18 bda8fae9be8838d4  d19 3fa4e646aea61780
10-17 11:08:15.182 I/DEBUG:     d20 be9268430fc7cebd  d21 bf5681410e45bf1c
10-17 11:08:15.182 I/DEBUG:     d22 3e21df360974ad63  d23 3ff0000000000000
10-17 11:08:15.182 I/DEBUG:     d24 3fe6216191e9aa70  d25 3fd3bd3cdc2cab20
10-17 11:08:15.182 I/DEBUG:     d26 0000000000000000  d27 3f8fcf331262ca11
10-17 11:08:15.182 I/DEBUG:     d28 3fe6a09e5e333598  d29 0001000000010000
10-17 11:08:15.182 I/DEBUG:     d30 010b400001088000  d31 01108000010e0000
10-17 11:08:15.182 I/DEBUG:     scr 60000012
10-17 11:08:15.182 I/DEBUG: backtrace:
10-17 11:08:15.182 I/DEBUG:     #00  pc 1d20001e  <unknown>
10-17 11:08:15.182 I/DEBUG:     #01  pc 00035ba7  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #02  pc 000259b5  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #03  pc 00004b4f  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #04  pc 00005805  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #05  pc 00023433  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #06  pc 00023aa7  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #07  pc 0002cd07  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #08  pc 0002cdfd  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.182 I/DEBUG:     #09  pc 0001dbcc  /system/lib/libdvm.so (dvmPlatformInvoke+112)
10-17 11:08:15.182 I/DEBUG:     #10  pc 0004e123  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
10-17 11:08:15.182 I/DEBUG:     #11  pc 0004fb0d  /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+184)
10-17 11:08:15.182 I/DEBUG:     #12  pc 00026fe0  /system/lib/libdvm.so
10-17 11:08:15.182 I/DEBUG:     #13  pc 0002dfa0  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
10-17 11:08:15.182 I/DEBUG:     #14  pc 0002b638  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
10-17 11:08:15.182 I/DEBUG:     #15  pc 0006057d  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
10-17 11:08:15.182 I/DEBUG:     #16  pc 000605a1  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
10-17 11:08:15.182 I/DEBUG:     #17  pc 00055287  /system/lib/libdvm.so
10-17 11:08:15.182 I/DEBUG:     #18  pc 0000d170  /system/lib/libc.so (__thread_entry+72)
10-17 11:08:15.182 I/DEBUG:     #19  pc 0000d308  /system/lib/libc.so (pthread_create+240)
10-17 11:08:15.182 I/DEBUG: stack:
10-17 11:08:15.182 I/DEBUG:          7789efa8  00000000  
10-17 11:08:15.182 I/DEBUG:          7789efac  7789efc8  [stack:6649]
10-17 11:08:15.182 I/DEBUG:          7789efb0  00000078  
10-17 11:08:15.182 I/DEBUG:          7789efb4  4159d52d  /system/lib/libdvm.so
10-17 11:08:15.182 I/DEBUG:          7789efb8  44742d10  /dev/ashmem/dalvik-heap (deleted)
10-17 11:08:15.182 I/DEBUG:          7789efbc  415a0751  /system/lib/libdvm.so
10-17 11:08:15.182 I/DEBUG:          7789efc0  7789efd0  [stack:6649]
10-17 11:08:15.182 I/DEBUG:          7789efc4  7789efe4  [stack:6649]
10-17 11:08:15.182 I/DEBUG:          7789efc8  7758a770  [anon:libc_malloc]
10-17 11:08:15.182 I/DEBUG:          7789efcc  7789efe4  [stack:6649]
10-17 11:08:15.182 I/DEBUG:          7789efd0  00000000  
10-17 11:08:15.192 I/DEBUG:          7789efd4  00000000  
10-17 11:08:15.192 I/DEBUG:          7789efd8  1da00015  
10-17 11:08:15.192 I/DEBUG:          7789efdc  75484b9d  /data/app-lib/$package$-1/libjdns_sd_embedded.so
10-17 11:08:15.192 I/DEBUG:          7789efe0  6d900a10  /dev/ashmem/dalvik-LinearAlloc (deleted)
10-17 11:08:15.192 I/DEBUG:          7789efe4  1d20003b  
10-17 11:08:15.192 I/DEBUG:     #00  7789efe8  00000002  
10-17 11:08:15.192 I/DEBUG:          ........  ........
10-17 11:08:15.192 I/DEBUG:     #01  7789efe8  00000002  
10-17 11:08:15.192 I/DEBUG:          7789efec  00000000  
10-17 11:08:15.192 I/DEBUG:          7789eff0  1da00015  
10-17 11:08:15.192 I/DEBUG:          7789eff4  00000001  
10-17 11:08:15.192 I/DEBUG:          7789eff8  00000001  
10-17 11:08:15.192 I/DEBUG:          7789effc  1dc00011  
10-17 11:08:15.192 I/DEBUG:          7789f000  00000078  
10-17 11:08:15.192 I/DEBUG:          7789f004  00000000  
10-17 11:08:15.192 I/DEBUG:          7789f008  00000001  
10-17 11:08:15.192 I/DEBUG:          7789f00c  00000002  
10-17 11:08:15.192 I/DEBUG:          7789f010  00000078  
10-17 11:08:15.192 I/DEBUG:          7789f014  00000000  
10-17 11:08:15.192 I/DEBUG:          7789f018  7549cfb8  
10-17 11:08:15.192 I/DEBUG:          7789f01c  7789f06b  [stack:6649]
10-17 11:08:15.192 I/DEBUG:          7789f020  00000001  
10-17 11:08:15.192 I/DEBUG:          7789f024  00000002  
10-17 11:08:15.192 I/DEBUG:          ........  ........
10-17 11:08:15.192 I/DEBUG:     #02  7789f048  7789f06b  [stack:6649]
10-17 11:08:15.192 I/DEBUG:          7789f04c  00000001  
10-17 11:08:15.192 I/DEBUG:          7789f050  00000001  
10-17 11:08:15.192 I/DEBUG:          7789f054  00000004  
10-17 11:08:15.192 I/DEBUG:          7789f058  7549cfb8  
10-17 11:08:15.192 I/DEBUG:          7789f05c  00000078  
10-17 11:08:15.192 I/DEBUG:          7789f060  77c6d5e8  [anon:libc_malloc]
10-17 11:08:15.192 I/DEBUG:          7789f064  00000000  
10-17 11:08:15.192 I/DEBUG:          7789f068  61000000  /dev/ashmem/dalvik-heap (deleted)
10-17 11:08:15.192 I/DEBUG:          7789f06c  6f637070  /system/framework/framework2.odex
10-17 11:08:15.192 I/DEBUG:          7789f070  692d736d  /dev/ashmem/dalvik-mark-stack (deleted)
10-17 11:08:15.192 I/DEBUG:          7789f074  2e63614d  
10-17 11:08:15.192 I/DEBUG:          7789f078  61636f6c  /dev/ashmem/dalvik-heap (deleted)
10-17 11:08:15.192 I/DEBUG:          7789f07c  2e002e6c  
10-17 11:08:15.192 I/DEBUG:          7789f080  63707000  /dev/ashmem/dalvik-mark-stack (deleted)
10-17 11:08:15.192 I/DEBUG:          7789f084  5c736d6f  /dev/ashmem/dalvik-heap (deleted)
10-17 11:08:15.192 I/DEBUG:          ........  ........
10-17 11:08:15.192 I/DEBUG: memory near r0:
10-17 11:08:15.192 I/DEBUG:     401561a8 00000000 00000000 401561a8 401561a8  
10-17 11:08:15.192 I/DEBUG:     401561b8 401561b0 401561b0 77c6d9e8 77c6d9e8  
10-17 11:08:15.202 I/DEBUG:     401561c8 77c6cc60 77c6cc60 77c6d5e0 77c6d5a0  
10-17 11:08:15.202 I/DEBUG:     401561d8 77c6d5a0 77c6d5a0 77c6c890 77c6c890  
10-17 11:08:15.202 I/DEBUG:     401561e8 77c9b248 778b02c0 77587a98 77587a98  
10-17 11:08:15.202 I/DEBUG:     401561f8 77c6cc60 77c6cc60 77c6c6c0 77c6c6c0  
10-17 11:08:15.202 I/DEBUG:     40156208 778b1e98 778b1e98 77cfd0e0 77cfd0e0  
10-17 11:08:15.202 I/DEBUG:     40156218 7758b5b8 77c8f2a8 77c6b808 77c56a70  
10-17 11:08:15.202 I/DEBUG:     40156228 77c6bad0 77c6bad0 77c6d918 77c6d918  
10-17 11:08:15.202 I/DEBUG:     40156238 41a1ace8 41a1ace8 77c22e50 77c22e50  
10-17 11:08:15.202 I/DEBUG:     40156248 77595f18 77d03ef8 77c6bee8 77c6bee8  
10-17 11:08:15.202 I/DEBUG:     40156258 77c6c9e0 77b145b8 77c57ca8 77c57ca8  
10-17 11:08:15.202 I/DEBUG:     40156268 77c8f100 77c8f100 77c15c70 77c15c70  
10-17 11:08:15.202 I/DEBUG:     40156278 77c6c728 77c6c728 77cf62d8 77cf62d8  
10-17 11:08:15.202 I/DEBUG:     40156288 77cf6088 77b13f48 77c6d918 77c6d918  
10-17 11:08:15.202 I/DEBUG:     40156298 77cfc600 77cfc600 77cfe4a8 77cfe4a8  
10-17 11:08:15.202 I/DEBUG: memory near r1:
10-17 11:08:15.202 I/DEBUG:     1d9ffff4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00004 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00014 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00024 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00034 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00044 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00054 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00064 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00074 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00084 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00094 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000a4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000b4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000c4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000d4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000e4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG: memory near r2:
10-17 11:08:15.202 I/DEBUG:     1d1ffffc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20000c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20001c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20002c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20003c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20004c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20005c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20006c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20007c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20008c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d20009c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d2000ac ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d2000bc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d2000cc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d2000dc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1d2000ec ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG: memory near r4:
10-17 11:08:15.202 I/DEBUG:     1d9ffff4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00004 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00014 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00024 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00034 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00044 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00054 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00064 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00074 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00084 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da00094 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000a4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000b4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000c4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000d4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG:     1da000e4 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.202 I/DEBUG: memory near r6:
10-17 11:08:15.202 I/DEBUG:     415a06ec fde0f01f b1384601 9803ab04 0028e88d  
10-17 11:08:15.202 I/DEBUG:     415a06fc 23014622 fe94f013 f7fca803 b007ff0b  
10-17 11:08:15.202 I/DEBUG:     415a070c b40cbdf0 b5104603 460cb086 4619a802  
10-17 11:08:15.202 I/DEBUG:     415a071c fed8f7fc 98024621 ff10f7fd 46049908  
10-17 11:08:15.202 I/DEBUG:     415a072c f01f6800 4601fdbf ab09b148 9303aa04  
10-17 11:08:15.202 I/DEBUG:     415a073c 000ce88d 98024622 f0132301 a802fe71  
10-17 11:08:15.202 I/DEBUG:     415a074c fee8f7fc e8bdb006 b0024010 b5f04770  
10-17 11:08:15.202 I/DEBUG:     415a075c b0874607 a803460c 46164639 f7fc461d  
10-17 11:08:15.202 I/DEBUG:     415a076c 4621feb1 f7fd9803 4631fee9 68004604  
10-17 11:08:15.202 I/DEBUG:     415a077c fd98f01f b1504601 4622ab04 0028e88d  
10-17 11:08:15.202 I/DEBUG:     415a078c 98032301 fd8ef013 4504e9dd 2400e001  
10-17 11:08:15.202 I/DEBUG:     415a079c a8032500 febef7fc 46294620 bdf0b007  
10-17 11:08:15.202 I/DEBUG:     415a07ac 4607b5f0 460cb087 4639a803 461d4616  
10-17 11:08:15.202 I/DEBUG:     415a07bc fe88f7fc 98034621 fec0f7fd 46044631  
10-17 11:08:15.202 I/DEBUG:     415a07cc f01f6800 4601fd6f ab04b150 e88d4622  
10-17 11:08:15.202 I/DEBUG:     415a07dc 23010028 f0139803 e9ddfe23 e0014504  
10-17 11:08:15.202 I/DEBUG: memory near r7:
10-17 11:08:15.202 I/DEBUG:     7789f010 00000078 00000000 7549cfb8 7789f06b  
10-17 11:08:15.212 I/DEBUG:     7789f020 00000001 00000002 00000004 77c6d1b0  
10-17 11:08:15.212 I/DEBUG:     7789f030 7789f46c 7789f06b 7549cf68 00000000  
10-17 11:08:15.212 I/DEBUG:     7789f040 00010001 754749b7 7789f06b 00000001  
10-17 11:08:15.212 I/DEBUG:     7789f050 00000001 00000004 7549cfb8 00000078  
10-17 11:08:15.212 I/DEBUG:     7789f060 77c6d5e8 00000000 61000000 6f637070  
10-17 11:08:15.212 I/DEBUG:     7789f070 692d736d 2e63614d 61636f6c 2e002e6c  
10-17 11:08:15.212 I/DEBUG:     7789f080 63707000 5c736d6f 69323330 2963614d  
10-17 11:08:15.212 I/DEBUG:     7789f090 74685f2e 5f2e7074 2e706374 61636f6c  
10-17 11:08:15.212 I/DEBUG:     7789f0a0 00002e6c 00000000 00000000 00000000  
10-17 11:08:15.212 I/DEBUG:     7789f0b0 00000000 00000000 00000000 7789f1e5  
10-17 11:08:15.212 I/DEBUG:     7789f0c0 7789f311 7789f30f 7789f2e2 7789f310  
10-17 11:08:15.212 I/DEBUG:     7789f0d0 000001ff 7789f55c 00000000 7758ea44  
10-17 11:08:15.212 I/DEBUG:     7789f0e0 ffffffff 754ae860 7789f540 7758cb18  
10-17 11:08:15.212 I/DEBUG:     7789f0f0 00000000 75457b07 7789f1d4 7789f7e4  
10-17 11:08:15.212 I/DEBUG:     7789f100 7789f4ec 4012ea8d 00000005 00000005  
10-17 11:08:15.212 I/DEBUG: memory near r8:
10-17 11:08:15.212 I/DEBUG:     1dbffff0 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00000 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00010 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00020 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00030 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00040 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00050 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00060 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00070 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00080 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc00090 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc000a0 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc000b0 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc000c0 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc000d0 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG:     1dc000e0 ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.212 I/DEBUG: memory near r9:
10-17 11:08:15.212 I/DEBUG:     77c6d5c8 77cfc390 2d373735 1d200033 1d200037  
10-17 11:08:15.212 I/DEBUG:     77c6d5d8 6d900a10 00000000 61636f6c 00000021  
10-17 11:08:15.212 I/DEBUG:     77c6d5e8 77c6d5a0 401561c8 1d20003b 1d20003f  
10-17 11:08:15.212 I/DEBUG:     77c6d5f8 6d900a10 00000000 00000020 00000022  
10-17 11:08:15.212 I/DEBUG:     77c6d608 77c99480 00000001 1d200043 1d200047  
10-17 11:08:15.212 I/DEBUG:     77c6d618 6d900a10 00000000 00000000 00000299  
10-17 11:08:15.212 I/DEBUG:     77c6d628 77c6d620 77c6d620 77c6c2a0 00000000  
10-17 11:08:15.212 I/DEBUG:     77c6d638 401562b8 00000002 00000000 00000000  
10-17 11:08:15.212 I/DEBUG:     77c6d648 44870000 44de0000 000006f0 3f800000  
10-17 11:08:15.212 I/DEBUG:     77c6d658 00000000 00000000 00000000 00000000  
10-17 11:08:15.212 I/DEBUG:     77c6d668 3f800000 00000000 00000000 00000000  
10-17 11:08:15.212 I/DEBUG:     77c6d678 00000000 3f800000 00000000 00000000  
10-17 11:08:15.212 I/DEBUG:     77c6d688 00000000 00000000 3f800000 00000010  
10-17 11:08:15.212 I/DEBUG:     77c6d698 77c6d6ac 77c6d6f0 77c6d710 00000000  
10-17 11:08:15.212 I/DEBUG:     77c6d6a8 3f800000 3f800000 00000000 00000000  
10-17 11:08:15.222 I/DEBUG:     77c6d6b8 00000000 00000000 3f800000 00000000  
10-17 11:08:15.222 I/DEBUG: memory near sl:
10-17 11:08:15.222 I/DEBUG:     4159ed6c e006fb0b 99083010 0044eb00 f7d2006a  
10-17 11:08:15.222 I/DEBUG:     4159ed7c a801ea1c fbcef7fe bf00bdfe 00048c11  
10-17 11:08:15.222 I/DEBUG:     4159ed8c 4607b5f7 a801460e 46144639 f7fe461d  
10-17 11:08:15.222 I/DEBUG:     4159ed9c 9801fb99 f7ff4631 2c00fbd1 2d00db05  
10-17 11:08:15.222 I/DEBUG:     4159edac 6883db03 429a1962 4b08dd06 462a4621  
10-17 11:08:15.222 I/DEBUG:     4159edbc f7fe447b e005fae1 99083010 462a1900  
10-17 11:08:15.222 I/DEBUG:     4159edcc e9f2f7d2 f7fea801 bdfefba5 00048bbd  
10-17 11:08:15.222 I/DEBUG:     4159eddc 4607b5f7 a801460e 46144639 f7fe461d  
10-17 11:08:15.222 I/DEBUG:     4159edec 9801fb71 f7ff4631 2c00fba9 2d00db05  
10-17 11:08:15.222 I/DEBUG:     4159edfc 6883db03 429a1962 4b08dd06 462a4621  
10-17 11:08:15.222 I/DEBUG:     4159ee0c f7fe447b e005fab9 99083010 462a1900  
10-17 11:08:15.222 I/DEBUG:     4159ee1c e9caf7d2 f7fea801 bdfefb7d 00048b6d  
10-17 11:08:15.222 I/DEBUG:     4159ee2c 4607b5f7 a801460e 46144639 f7fe461d  
10-17 11:08:15.222 I/DEBUG:     4159ee3c 9801fb49 f7ff4631 2c00fb81 db054603  
10-17 11:08:15.222 I/DEBUG:     4159ee4c db032d00 19616882 dd074291 4b094618  
10-17 11:08:15.222 I/DEBUG:     4159ee5c 462a4621 f7fe447b e006fa8f 98081ca1  
10-17 11:08:15.222 I/DEBUG: memory near ip:
10-17 11:08:15.222 I/DEBUG:     7758a770 7524c374 777a1fc0 6d8fb748 753b6000  
10-17 11:08:15.222 I/DEBUG:     7758a780 00000015 00000007 7789fc40 00000000  
10-17 11:08:15.222 I/DEBUG:     7758a790 7789fc94 00000012 00000000 41571d40  
10-17 11:08:15.222 I/DEBUG:     7758a7a0 00000000 00000000 40dd1d70 7779e300  
10-17 11:08:15.222 I/DEBUG:     7758a7b0 00000000 00000000 00000001 00004000  
10-17 11:08:15.222 I/DEBUG:     7758a7c0 00000000 7758abc8 41571d40 41576c00  
10-17 11:08:15.222 I/DEBUG:     7758a7d0 00000000 4157acfc 4157ad70 4157ac20  
10-17 11:08:15.222 I/DEBUG:     7758a7e0 4157ac40 4157ac9c 00000000 00000000  
10-17 11:08:15.222 I/DEBUG:     7758a7f0 77c6b008 00000028 00000000 00000000  
10-17 11:08:15.222 I/DEBUG:     7758a800 00000000 00000006 00002000 4160391c  
10-17 11:08:15.222 I/DEBUG:     7758a810 00000000 00000000 00000006 7758ae10  
10-17 11:08:15.222 I/DEBUG:     7758a820 00000001 00000040 00000200 00000000  
10-17 11:08:15.222 I/DEBUG:     7758a830 00000001 752e0bb8 752e0bb8 00000002  
10-17 11:08:15.222 I/DEBUG:     7758a840 752e0bf4 6d8faa30 102ebefe 1df01b5c  
10-17 11:08:15.222 I/DEBUG:     7758a850 ea8c058d ea8c0600 6d262a65 6d262a64  
10-17 11:08:15.222 I/DEBUG:     7758a860 ea6e853c 98b431bd 00000000 ea8c05f8  
10-17 11:08:15.222 I/DEBUG: memory near sp:
10-17 11:08:15.222 I/DEBUG:     7789efc8 7758a770 7789efe4 00000000 00000000  
10-17 11:08:15.222 I/DEBUG:     7789efd8 1da00015 75484b9d 6d900a10 1d20003b  
10-17 11:08:15.222 I/DEBUG:     7789efe8 00000002 00000000 1da00015 00000001  
10-17 11:08:15.222 I/DEBUG:     7789eff8 00000001 1dc00011 00000078 00000000  
10-17 11:08:15.222 I/DEBUG:     7789f008 00000001 00000002 00000078 00000000  
10-17 11:08:15.222 I/DEBUG:     7789f018 7549cfb8 7789f06b 00000001 00000002  
10-17 11:08:15.222 I/DEBUG:     7789f028 00000004 77c6d1b0 7789f46c 7789f06b  
10-17 11:08:15.222 I/DEBUG:     7789f038 7549cf68 00000000 00010001 754749b7  
10-17 11:08:15.222 I/DEBUG:     7789f048 7789f06b 00000001 00000001 00000004  
10-17 11:08:15.222 I/DEBUG:     7789f058 7549cfb8 00000078 77c6d5e8 00000000  
10-17 11:08:15.222 I/DEBUG:     7789f068 61000000 6f637070 692d736d 2e63614d  
10-17 11:08:15.222 I/DEBUG:     7789f078 61636f6c 2e002e6c 63707000 5c736d6f  
10-17 11:08:15.222 I/DEBUG:     7789f088 69323330 2963614d 74685f2e 5f2e7074  
10-17 11:08:15.222 I/DEBUG:     7789f098 2e706374 61636f6c 00002e6c 00000000  
10-17 11:08:15.222 I/DEBUG:     7789f0a8 00000000 00000000 00000000 00000000  
10-17 11:08:15.222 I/DEBUG:     7789f0b8 00000000 7789f1e5 7789f311 7789f30f  
10-17 11:08:15.222 I/DEBUG: code around pc:
10-17 11:08:15.222 I/DEBUG:     1d1ffffc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.222 I/DEBUG:     1d20000c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20001c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20002c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20003c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20004c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20005c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20006c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20007c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20008c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d20009c ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d2000ac ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d2000bc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d2000cc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d2000dc ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG:     1d2000ec ffffffff ffffffff ffffffff ffffffff  
10-17 11:08:15.232 I/DEBUG: code around lr:
10-17 11:08:15.232 I/DEBUG:     75484b88 5401e9cd 95039d0e e9cd9d08 9d0a5804  
10-17 11:08:15.232 I/DEBUG:     75484b98 47b09506 0004f8d9 6dca6801 47904621  
10-17 11:08:15.232 I/DEBUG:     75484ba8 0004f8d9 6dca6801 b00f4641 4ff0e8bd  
10-17 11:08:15.232 I/DEBUG:     75484bb8 bf004710 0002817c 00012e62 00012e70  
10-17 11:08:15.232 I/DEBUG:     75484bc8 4ff0e92d b083af03 46914605 46986828  
10-17 11:08:15.232 I/DEBUG:     75484bd8 6fc2460c 47904628 68284601 4b224a21  
10-17 11:08:15.232 I/DEBUG:     75484be8 6178f8d0 447b447a 47b04628 f1ba4682  
10-17 11:08:15.232 I/DEBUG:     75484bf8 d02f0f00 46284a1d 46214b1d 447b447a  
10-17 11:08:15.232 I/DEBUG:     75484c08 ffb0f7fe b32e4606 68f16828 f8d06fc2  
10-17 11:08:15.232 I/DEBUG:     75484c18 4628b084 4a174790 4b174601 447a4628  
10-17 11:08:15.232 I/DEBUG:     75484c28 47d8447b 46494b15 46306170 4642447b  
10-17 11:08:15.232 I/DEBUG:     75484c38 f7ef9600 b950f89e 46216828 f8d04652  
10-17 11:08:15.232 I/DEBUG:     75484c48 17f031b8 6000e9cd 47984628 b0032000  
10-17 11:08:15.232 I/DEBUG:     75484c58 8ff0e8bd 70fdf64f 70fef6cf e8bdb003  
10-17 11:08:15.232 I/DEBUG:     75484c68 bf008ff0 00012b76 00012b83 00012cde  
10-17 11:08:15.232 I/DEBUG:     75484c78 00012ce8 00012cee 00012cc6 00000051  
10-17 11:08:15.232 I/DEBUG: memory map around fault addr 1d20001e:
10-17 11:08:15.232 I/DEBUG:     (no map below)
10-17 11:08:15.232 I/DEBUG:     (no map for address)
10-17 11:08:15.232 I/DEBUG:     400de000-400e0000 r-x /system/bin/app_process

┆Issue is synchronized with this Asana task

Help required in finding the ipaddress of the service found

I have successfully found using the browse method in DNSSD class and now I'm trying to find the ipaddress of the found service using queryRecord. Unforutantely I'm not able to get the trigger to the QueryListener that is passed to the queryRecord call. I believe that Im doing something wrong, can you please help me what is the mistake in this code.


try {
            this.browseService = dnssd.browse(SERVICE_TYPE, object : BrowseListener {

                override fun serviceFound(browser: DNSSDService, flags: Int, ifIndex: Int,
                                          serviceName: String, regType: String, domain: String) {
                    LoggingUtil.log("Found in Service " + serviceName + " Domain : " + domain)

                    dnssd.queryRecord(flags, ifIndex, serviceName, 1, 1, object : QueryListener {
                        override fun queryAnswered(query: DNSSDService?, flags: Int, ifIndex: Int, fullName: String?, rrtype: Int, rrclass: Int, rdata: InetAddress?, ttl: Int) {

                            LoggingUtil.log("Found the answer for the Query : " + rdata?.hostName + " - " + rdata?.hostAddress + " _ Address : " + String(rdata?.address!!))
                        }

                        override fun operationFailed(service: DNSSDService?, errorCode: Int) {
                            LoggingUtil.log("Unable to find the address : " + errorCode)
                        }

                    })
                }

                override fun serviceLost(browser: DNSSDService, flags: Int, ifIndex: Int,
                                         serviceName: String, regType: String, domain: String) {
                    LoggingUtil.log("Lost " + serviceName)
                }

                override fun operationFailed(service: DNSSDService, errorCode: Int) {
                    LoggingUtil.log("error: " + errorCode)
                }
            })
        } catch (e: DNSSDException) {
            LoggingUtil.log("error : " + e.message)
        }

rx2dnssd not available via jcenter

I am not very familiar with publishing libraries but it seems that unlike your previous ones rx2dnssd is not available via jcenter. I have problems resolving this dependency in Android Studio even though my repositories look like this:

repositories {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
    mavenCentral()
  }

On bintray the Linked to section is empty too.

Or is there any other way to resolve it?

Greetings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.