Stay organized with collections
Save and categorize content based on your preferences.
WifiP2pManager.ServiceResponseListener
public
static
interface
WifiP2pManager.ServiceResponseListener
android.net.wifi.p2p.WifiP2pManager.ServiceResponseListener
|
Interface for callback invocation when service discovery response other than
Upnp or Bonjour is received
Summary
Public methods
onServiceAvailable
public abstract void onServiceAvailable (int protocolType,
byte[] responseData,
WifiP2pDevice srcDevice)
The requested service response is available.
Parameters |
protocolType |
int : protocol type. currently only
WifiP2pServiceInfo.SERVICE_TYPE_VENDOR_SPECIFIC . |
responseData |
byte : service discovery response data based on the requested
service protocol type. The format depends on the service type. |
srcDevice |
WifiP2pDevice : source device. |
onUsdBasedServiceAvailable
public void onUsdBasedServiceAvailable (WifiP2pDevice srcDevice,
WifiP2pUsdBasedServiceResponse usdResponseData)
The requested USD based service response is available.
Parameters |
srcDevice |
WifiP2pDevice : source device.
This value cannot be null . |
usdResponseData |
WifiP2pUsdBasedServiceResponse : WifiP2pUsdBasedServiceResponse .
This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# WifiP2pManager.ServiceResponseListener\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nWifiP2pManager.ServiceResponseListener\n======================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/net/wifi/p2p/WifiP2pManager.ServiceResponseListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nWifiP2pManager.ServiceResponseListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------------|\n| android.net.wifi.p2p.WifiP2pManager.ServiceResponseListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for callback invocation when service discovery response other than\nUpnp or Bonjour is received\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onServiceAvailable](/reference/android/net/wifi/p2p/WifiP2pManager.ServiceResponseListener#onServiceAvailable(int,%20byte[],%20android.net.wifi.p2p.WifiP2pDevice))`(int protocolType, byte[] responseData, `[WifiP2pDevice](/reference/android/net/wifi/p2p/WifiP2pDevice)` srcDevice) ` The requested service response is available. |\n| ` default void` | ` `[onUsdBasedServiceAvailable](/reference/android/net/wifi/p2p/WifiP2pManager.ServiceResponseListener#onUsdBasedServiceAvailable(android.net.wifi.p2p.WifiP2pDevice,%20android.net.wifi.p2p.nsd.WifiP2pUsdBasedServiceResponse))`(`[WifiP2pDevice](/reference/android/net/wifi/p2p/WifiP2pDevice)` srcDevice, `[WifiP2pUsdBasedServiceResponse](/reference/android/net/wifi/p2p/nsd/WifiP2pUsdBasedServiceResponse)` usdResponseData) ` The requested USD based service response is available. |\n\nPublic methods\n--------------\n\n### onServiceAvailable\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onServiceAvailable (int protocolType, \n byte[] responseData, \n WifiP2pDevice srcDevice)\n```\n\nThe requested service response is available.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `protocolType` | `int`: protocol type. currently only [WifiP2pServiceInfo.SERVICE_TYPE_VENDOR_SPECIFIC](/reference/android/net/wifi/p2p/nsd/WifiP2pServiceInfo#SERVICE_TYPE_VENDOR_SPECIFIC). \u003cbr /\u003e |\n| `responseData` | `byte`: service discovery response data based on the requested service protocol type. The format depends on the service type. \u003cbr /\u003e |\n| `srcDevice` | `WifiP2pDevice`: source device. \u003cbr /\u003e |\n\n### onUsdBasedServiceAvailable\n\nAdded in [API level 36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onUsdBasedServiceAvailable (WifiP2pDevice srcDevice, \n WifiP2pUsdBasedServiceResponse usdResponseData)\n```\n\nThe requested USD based service response is available.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `srcDevice` | `WifiP2pDevice`: source device. This value cannot be `null`. \u003cbr /\u003e |\n| `usdResponseData` | `WifiP2pUsdBasedServiceResponse`: [WifiP2pUsdBasedServiceResponse](/reference/android/net/wifi/p2p/nsd/WifiP2pUsdBasedServiceResponse). This value cannot be `null`. \u003cbr /\u003e |"]]