I started work on JmDNS bindings for Xamarin.Android. I managed to get the binding for the assembly, but I can not reference it from my code. https://github.com/ytn3rd/monodroid-bindings/tree/master/JmDNS
The first release I had was not for the IDNSListener class. Therefore, I added a partial interface there. I have a function for which it is needed void updateRecord (DNSCache dnsCache, for a long time, DNSEntry record); commented as he would complain about not being able to reference DNSCache or DNSEntry. (I believe that I deleted DNSCache and this is why)
Not sure if some of the things I did were bad, just deleting the nodes so that they could be compiled. For instnace. I added this to remove the following errors.
E: \ Users \ brads_000 \ Documents \ GitHub \ ytn3rd \ monodroid bindings \ JmDNS \ bindings \ OBJ \ Debug \ generated \ SRC \ Javax.Jmdns.Impl.JmDNSImpl.cs (24,24): Error CS0738: "Javax. Jmdns.Impl.JmDNSImpl.SubTypeEntry "does not implement the interface element" Java.Util.IMapEntry.Key ". 'Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry.Key' cannot implement "Java.Util.IMapEntry.Key" because it does not have a corresponding return type of "Java.Lang.Object". (CS0738) (JmDNS bindings) E: \ Users \ brads_000 \ Documents \ GitHub \ ytn3rd \ monodroid bindings \ JmDNS \ bindings \ OBJ \ Debug \ generated \ SRC \ Javax.Jmdns.Impl.JmDNSImpl.cs (24,24 ): Error CS0738: "Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry" did not implement the interface element "Java.Util.IMapEntry.Value". 'Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry.Value' cannot implement 'Java.Util.IMapEntry.Value' because it does not have the corresponding return type 'Java.Lang.Object'. (CS0738) (JmDNS bindings)
The problem is from the Java.Util.IMapEntry class. I thought that the correct action would be to create my own parit SubEntryType and then override the Key property of the Key, but it will not pick it up. My next attempt was to do this.
java.lang.Object
Which will resolve this error but then throw an error with
E: \ Users \ brads_000 \ Documents \ GitHub \ ytn3rd \ monodroid bindings \ JmDNS \ bindings \ OBJ \ Debug \ generated \ SRC \ Javax.Jmdns.Impl.JmDNSImpl.cs (12,12): Error CS1502: best overloaded method for 'Android.Runtime.JNIEnv.NewString (string)' has some invalid arguments (CS1502) (JmDNS bindings)
static IntPtr n_GetKey (IntPtr jnienv, IntPtr native__this) { global::Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry __this = global::Java.Lang.Object.GetObject<global::Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } namespace Javax.Jmdns.Impl { public partial class SubTypeEntry { static IntPtr n_GetKey (IntPtr jnienv, IntPtr native__this) { global::Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry __this = global::Java.Lang.Object.GetObject<global::Javax.Jmdns.Impl.JmDNSImpl.SubTypeEntry> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString(__this.Key.ToString()); } } }
But then again, he does not want to choose this new method.
I deleted javax.jmdns.impl.DNSCache due to the same errors with Key / Value as above, and
E: \ Users \ brads_000 \ Documents \ GitHub \ ytn3rd \ monodroid bindings \ JmDNS \ bindings \ OBJ \ Debug \ generated \ SRC \ Javax.Jmdns.Impl.DNSCache.cs (95.95): Error CS0508: 'Javax. Jmdns.Impl.DNSCache.EntrySet () ': the return type must be' System.Collections.ICollection 'to match the overridden member' Java.Util.AbstractMap.EntrySet () '(CS0508) (JmDNS-Bindings)
What I apparently fixed with
System.Collections.ICollection
Despite the fact that he has already returned.
public override global :: System.Collections.Generic.ICollection EntrySet ()
Anyway, any help would be appreciated to run this awesome library :)