Google is committed to advancing racial equity for Black communities. See how.

Nearby

public final class Nearby extends Object

API for communication with nearby devices.

Field Summary

public static final Api<Api.ApiOptions.NoOptions> CONNECTIONS_API This field was deprecated. Use getConnectionsClient(Context) instead.
public static final Connections Connections This field was deprecated. Use getConnectionsClient(Context) instead.
public static final Api<MessagesOptions> MESSAGES_API This field was deprecated. Use getMessagesClient(Context) instead.
public static final Messages Messages This field was deprecated. Use getMessagesClient(Context) instead.

Public Method Summary

final static ConnectionsClient
getConnectionsClient(Context context)
Creates a new instance of ConnectionsClient.
final static ConnectionsClient
getConnectionsClient(Activity activity)
Creates a new instance of ConnectionsClient.
final static MessagesClient
getMessagesClient(Activity activity, MessagesOptions options)
Creates a new instance of MessagesClient.
final static MessagesClient
getMessagesClient(Activity activity)
Creates a new instance of MessagesClient.
final static MessagesClient
getMessagesClient(Context context, MessagesOptions options)
Creates a new instance of MessagesClient.
final static MessagesClient
getMessagesClient(Context context)
Creates a new instance of MessagesClient.

Inherited Method Summary

Fields

public static final Api<Api.ApiOptions.NoOptions> CONNECTIONS_API

This field was deprecated.
Use getConnectionsClient(Context) instead.

public static final Connections Connections

This field was deprecated.
Use getConnectionsClient(Context) instead.

public static final Api<MessagesOptions> MESSAGES_API

This field was deprecated.
Use getMessagesClient(Context) instead.

public static final Messages Messages

This field was deprecated.
Use getMessagesClient(Context) instead.

Public Methods

public static final ConnectionsClient getConnectionsClient (Context context)

Creates a new instance of ConnectionsClient. Resolvable connections errors will create a system notification that the user can tap in order to resolve the error.

public static final ConnectionsClient getConnectionsClient (Activity activity)

Creates a new instance of ConnectionsClient. The given Activity will be used to automatically prompt for resolution of resolvable connection errors.

public static final MessagesClient getMessagesClient (Activity activity, MessagesOptions options)

Creates a new instance of MessagesClient. The given Activity will be used to automatically prompt for resolution of resolvable connection errors.

public static final MessagesClient getMessagesClient (Activity activity)

Creates a new instance of MessagesClient. The given Activity will be used to automatically prompt for resolution of resolvable connection errors.

public static final MessagesClient getMessagesClient (Context context, MessagesOptions options)

Creates a new instance of MessagesClient. Resolvable connections errors will create a system notification that the user can tap in order to resolve the error.

public static final MessagesClient getMessagesClient (Context context)

Creates a new instance of MessagesClient. Resolvable connections errors will create a system notification that the user can tap in order to resolve the error.