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 methods

abstract Participant

Gets the participant from an incoming Intent.

abstract @NonNull DevicePickerLauncher

Registers a callback for discovery.

Public methods

getParticipantFromIntent

abstract Participant getParticipantFromIntent(@NonNull Intent intent)

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

abstract @NonNull DevicePickerLauncher registerForResult(
    @NonNull ActivityResultCaller caller,
    @NonNull Discovery.OnDevicePickerResultListener callback
)

Registers a callback for discovery.

Parameters
@NonNull ActivityResultCaller caller

The calling activity or fragment.

@NonNull Discovery.OnDevicePickerResultListener callback

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

Returns
@NonNull DevicePickerLauncher

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