Code example for NsdServiceInfo

Methods: getServiceName, getServiceType

0
  /* (non-Javadoc) 
   * @see android.net.nsd.NsdManager.DiscoveryListener#onServiceFound(android.net.nsd.NsdServiceInfo) 
   */ 
  @Override 
  public void onServiceFound(NsdServiceInfo serviceInfo) {
    Log.d(TAG, "Found service:" + serviceInfo.getServiceType());
    if (serviceInfo.getServiceType() != CLEMENTINE_SERVICE_TYPE) {
      return; 
    } 
    Log.d(TAG, "Found clementine service: " + serviceInfo.getServiceName());
  } 
 
  /* (non-Javadoc) 
   * @see android.net.nsd.NsdManager.DiscoveryListener#onServiceLost(android.net.nsd.NsdServiceInfo) 
   */ 
  @Override 
  public void onServiceLost(NsdServiceInfo serviceInfo) {
  } 
 
  /* (non-Javadoc) 
   * @see android.net.nsd.NsdManager.DiscoveryListener#onStartDiscoveryFailed(java.lang.String, int)