Java Code Examples for android.net.nsd.NsdServiceInfo#getServiceName()
The following examples show how to use
android.net.nsd.NsdServiceInfo#getServiceName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThetaDeviceFactory.java From DeviceConnect-Android with MIT License | 6 votes |
public static ThetaDevice createDeviceFromNsdServiceInfo(final NsdServiceInfo serviceInfo) { InetAddress host = serviceInfo.getHost(); if (host == null) { return null; } String serviceName = serviceInfo.getServiceName(); if (serviceName == null) { return null; } // サービス名がSSIDと同一である前提 ThetaDeviceModel model = parseModel(serviceName); switch (model) { case THETA_V: String password = parsePasswordForDigestAuthentication(serviceName); Credentials credentials = new Credentials(serviceName, password); return new ThetaV(serviceName, host.getHostAddress(), credentials, null); default: return null; } }
Example 2
Source File: NsdService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
private boolean registerService(int regId, NsdServiceInfo service) { if (DBG) { Slog.d(TAG, "registerService: " + regId + " " + service); } String name = service.getServiceName(); String type = service.getServiceType(); int port = service.getPort(); byte[] textRecord = service.getTxtRecord(); String record = Base64.encodeToString(textRecord, Base64.DEFAULT).replace("\n", ""); return mDaemon.execute("register", regId, name, type, port, record); }
Example 3
Source File: NsdService.java From NsdHelper with Apache License 2.0 | 5 votes |
public NsdService(NsdServiceInfo nsdServiceInfo) { this.name = nsdServiceInfo.getServiceName(); this.type = nsdServiceInfo.getServiceType(); this.hostIp = nsdServiceInfo.getHost() == null ? null : nsdServiceInfo.getHost().getHostAddress(); this.hostName = nsdServiceInfo.getHost() == null ? null : nsdServiceInfo.getHost().getHostName(); this.port = nsdServiceInfo.getPort(); this.host = nsdServiceInfo.getHost(); }
Example 4
Source File: DiscoverResolver.java From tinydnssd with MIT License | 5 votes |
@Override public void onServiceFound(final NsdServiceInfo serviceInfo) { Log.d(TAG, "onServiceFound() serviceInfo = [" + serviceInfo + "]"); synchronized (DiscoverResolver.this) { if (mStarted) { String name = serviceInfo.getServiceName() + "." + serviceInfo.getServiceType() + "local"; mDebouncer.put(name, DUMMY); } } }
Example 5
Source File: DiscoverResolver.java From tinydnssd with MIT License | 5 votes |
@Override public void onServiceLost(final NsdServiceInfo serviceInfo) { Log.d(TAG, "onServiceLost() serviceInfo = [" + serviceInfo + "]"); synchronized (DiscoverResolver.this) { if (mStarted) { String name = serviceInfo.getServiceName() + "." + serviceInfo.getServiceType() + "local"; mDebouncer.put(name, null); } } }
Example 6
Source File: NsdService.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
private boolean resolveService(int resolveId, NsdServiceInfo service) { String name = service.getServiceName(); String type = service.getServiceType(); return mDaemon.execute("resolve", resolveId, name, type, "local."); }