standard ▸ UPnP/DLNA are somehow similar, but different people and ideas ▸ Apple has its own implementation, called Bonjour (once Rendezvous) ▸ On Android, we have very different solutions for using it
over scalability ▸ 4 areas: IP interface configuration, translation between host name and IP address, IP multicast address allocation, service discovery ▸ Aware of network changes ▸ Still a draft HOW DOES IT WORK?
discoverable via identifier and/or type ▸ Discovery without the use of a service-specific protocol and should complete in a timely manner (10s of seconds) ▸ Prompt detection of new services in a timely manner (10s of seconds) D R A F T
part must start with _ (underscore) ▸ The second part only allows _tcp or _udp _ServiceType._TransportProtocolName. List of common services goo.gl/EXh1g
implement ▸ Runs on the main thread, unless we specify otherwise ▸ Distributed as JAR or via Maven repo ▸ Long start-up time ▸ Compatible with all the Android versions
custom attributes added with 5.1 (API 21) ▸ Already asynchronous, with return on the main thread ▸ Verbose, but easy to implement ▸ Based on two steps: discovery and resolution ▸ Only one service can be resolved at a time http://developer.android.com/training/connect-devices-wirelessly/nsd.html
= new NsdServiceInfo(); serviceInfo.setServiceName("DroidConService"); serviceInfo.setServiceType("_http._tcp."); serviceInfo.setPort(randomPort); nsdManager = Context.getSystemService(Context.NSD_SERVICE); nsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener); Remember to unregister the service upon app closing!
extends NsdManager.ResolveListener { @Override public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {} @Override public void onServiceResolved(NsdServiceInfo serviceInfo) { // here we can use our resolved service } }; Resolve resolveListener = new Resolve();
extends NsdManager.ResolveListener { @Override public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {} @Override public void onServiceResolved(NsdServiceInfo serviceInfo) { // here we can use our resolved service } }; Resolve resolveListener = new Resolve();