Discovery


@RequiresApi(value = 26) interface Discovery


Entry point for discovering devices.

Summary

Nested types

Discovery.Companion
Discovery.OnDevicePickerResultListener

Interface to receive the result from the device picker, for use with registerForResult.

Public functions

Participant?

Gets the participant from an incoming Intent.

DevicePickerLauncher

Registers a callback for discovery.

Public functions

getParticipantFromIntent

fun getParticipantFromIntent(intent: Intent): Participant?

Gets the participant from an incoming Intent. Used to begin the process of accepting a remote connection with a Participant. Returns null if the Intent is not valid for getting a Participant.

registerForResult

fun registerForResult(
    caller: ActivityResultCaller,
    callback: Discovery.OnDevicePickerResultListener
): DevicePickerLauncher

Registers a callback for discovery.

Parameters
caller: ActivityResultCaller

The calling activity or fragment.

callback: Discovery.OnDevicePickerResultListener

The callback to be called when devices are selected by a user.

Returns
DevicePickerLauncher

The launcher to use to show a device picker UI to the user.