How to get description string of jmDNS ServiceInfo whitch we specify in 4 parameters of this overload:
ServiceInfo mServiceInfo = ServiceInfo.create(TYPE, SERVICE_NAME, PORT, DESCRIPTION);
What method can I get value from DESCRIPTION variable of this instance.
Thanks in advance, regards...)
The following website has the documentation for the
ServiceInfoclass. http://jmdns.sourceforge.net/apidocs/javax/jmdns/ServiceInfo.htmlThe method you're looking for is
ServiceInfo.getNiceTextString(), which "Returns a description of the service info suitable for printing." This method returns the entire DESCRIPTION variable in a printable string. You can also use thegetPropertyNames()method with thegetPropertyBytes(String name)orgetPropertyString(String name)methods to get specific TXT entries and their values. For instance, if your DESCRIPTION variable is"color=blue"then you can callServiceInfo.getPropertyString("color")and it will return"blue".