java.lang.Object | |
↳ | com.google.android.gms.nearby.connection.ConnectionLifecycleCallback |
Listener for lifecycle events associated with a connection to a remote endpoint.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A basic encrypted channel has been created between you and the endpoint.
| |||||||||||
Called after both sides have either accepted or rejected the connection.
| |||||||||||
Called when a remote endpoint is disconnected or has become unreachable.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
A basic encrypted channel has been created between you and the endpoint. Both sides are now asked if they wish to accept or reject the connection before any data can be sent over this channel.
This is your chance, before you accept the connection, to confirm that you connected to the correct device. Both devices are given an identical token; it's up to you to decide how to verify it before proceeding. Typically this involves showing the token on both devices and having the users manually compare and confirm; however, this is only required if you desire a secure connection between the devices.
Whichever route you decide to take (including not authenticating the other device), call
acceptConnection(GoogleApiClient, String, PayloadCallback)
when you're
ready to talk, or rejectConnection(GoogleApiClient, String)
to close the
connection.
Parameters | |
---|---|
endpointId |
String :
The identifier for the remote endpoint. |
connectionInfo |
ConnectionInfo :
Other relevant information about the connection.
|
Called after both sides have either accepted or rejected the connection. If the ConnectionResolution
's status is SUCCESS
, both sides have
accepted the connection and may now send Payload
s to each other. Otherwise, the
connection was rejected.
Parameters | |
---|---|
endpointId |
String :
The identifier for the remote endpoint. |
resolution |
ConnectionResolution :
The final result after tallying both devices' accept/reject responses.
|
Called when a remote endpoint is disconnected or has become unreachable.
Parameters | |
---|---|
endpointId |
String :
The identifier for the remote endpoint that disconnected.
|