目录

CLASS info
public final class StatusCode
Represents a Nearby operation result code.

Constant Summary

TypeNameDesc
intSTATUS_SUCCESSOperation succeeded.
intSTATUS_FAILUREOperation failed.
intSTATUS_API_DISORDERAPI calls are out of order.
intSTATUS_NO_NETWORKThe local endpoint is not connected to the Wi-Fi or Ethernet.
intSTATUS_NOT_CONNECTEDThe remote endpoint is not connected, and data cannot be sent to it.
intSTATUS_TRANSFER_IO_ERRORFailed to read or write a file or data streams.
intSTATUS_ALREADY_BROADCASTINGThe app is broadcasting. Stop the broadcasting before broadcasting again.
intSTATUS_ALREADY_CONNECTEDThe app is already connected to the same remote endpoint.
intSTATUS_ALREADY_SCANNINGThe app is scanning for nearby devices. Stop the scanning before scanning again.
intSTATUS_POLICY_CONFLICTA policy is used by the ongoing scanning and connection. Stop the scanning and connection before enabling a new policy.
intSTATUS_BLUETOOTH_OPERATION_FAILEDThe connection failed due to a Bluetooth error.
intSTATUS_CONNECT_REJECTEDThe remote endpoint rejected the connection.
intSTATUS_CONNECT_IO_ERRORFailed to communicate with a connected remote endpoint. If this error occurs frequently, disconnect from the remote endpoint and reconnect to it.
intSTATUS_ENDPOINT_UNKNOWNAttempting to connect to an unknown remote endpoint. The endpoint has not been discovered or connected to other devices yet.
intSTATUS_API_OCCUPIEDNearby API has been already called by another app, and is unavailable now.
intSTATUS_MISSING_PERMISSION_ACCESS_COARSE_LOCATIONThe ACCESS_COARSE_LOCATION permission is required.
intSTATUS_MISSING_PERMISSION_ACCESS_WIFI_STATEThe ACCESS_WIFI_STATE permission is required.
intSTATUS_MISSING_PERMISSION_BLUETOOTHThe BLUETOOTH permission is required.
intSTATUS_MISSING_PERMISSION_BLUETOOTH_ADMINThe BLUETOOTH_ADMIN permission is required.
intSTATUS_MISSING_PERMISSION_CHANGE_WIFI_STATEThe CHANGE_WIFI_STATE permission is required.
intSTATUS_MISSING_PERMISSION_RECORD_AUDIOThe RECORD_AUDIO permission is required.
intSTATUS_MISSING_SETTING_LOCATION_ONThe location permission must be enabled.
intSTATUS_MESSAGE_APP_UNREGISTEREDThe user has not granted the permission to call the Message API.
intSTATUS_MESSAGE_APP_QUOTA_LIMITEDThe app has reached its quota limit to call Nearby Message APIs. You can increase your quota limit.
intSTATUS_MESSAGE_BLE_BROADCASTING_UNSUPPORTEDThe Message API is called to perform an operation that requires BLE broadcasting, but this function is not supported.
intSTATUS_MESSAGE_BLE_SCANNING_UNSUPPORTEDThe Message API is called to perform an operation that requires BLE scanning, but this function is not supported.
intSTATUS_MESSAGE_BLUETOOTH_OFFThe Bluetooth function needs to be turned on for calling the Message API.
intSTATUS_MESSAGE_WRONG_CONTEXTThe context of the Message API is invalid.
intSTATUS_MESSAGE_NOT_ALLOWThe Message API is disabled.
intSTATUS_MESSAGE_MISSING_PERMISSIONSThe request for calling the Message API is rejected due to insufficient permissions.
intSTATUS_MESSAGE_AUTH_FAILEDThe Message API is not authorized.
intSTATUS_MESSAGEPENDING_INTENTS_LIMITEDThe number of message subscriptions initiated by the app has exceeded the upper limit allowed by PendingIntent. Before initiating a new subscription, delete existing subscriptions.

Public Method Summary

Return typeMethod name
StringgetStatusCode(int statusCode)
Returns a character string based on a specified result code.

Constants

Constant
public static final int STATUS_SUCCESS
Operation succeeded.
Constant value: 0

Constant
public static final int STATUS_FAILURE
Operation failed.
Constant value: -1

Constant
public static final int STATUS_API_DISORDER
API calls are out of order.
Constant value: 8001

Constant
public static final int STATUS_NO_NETWORK
The local endpoint is not connected to the Wi-Fi or Ethernet.
Constant value: 8002

Constant
public static final int STATUS_NOT_CONNECTED
The remote endpoint is not connected, and data cannot be sent to it.
Constant value: 8003

Constant
public static final int STATUS_TRANSFER_IO_ERROR
Failed to read or write a file or data streams.
Constant value: 8004

Constant
public static final int STATUS_ALREADY_BROADCASTING
The app is broadcasting. Stop the broadcasting before broadcasting again.
Constant value: 8005

Constant
public static final int STATUS_ALREADY_CONNECTED
The app is already connected to the same remote endpoint.
Constant value: 8006

Constant
public static final int STATUS_ALREADY_SCANNING
The app is scanning for nearby devices. Stop the scanning before scanning again.
Constant value: 8007

Constant
public static final int STATUS_POLICY_CONFLICT
A policy is used by the ongoing scanning and connection. Stop the scanning and connection before enabling a new policy.
Constant value: 8008

Constant
public static final int STATUS_BLUETOOTH_OPERATION_FAILED
The connection failed due to a Bluetooth error.
Constant value: 8009

Constant
public static final int STATUS_CONNECT_REJECTED
The remote endpoint rejected the connection.
Constant value: 8010

Constant
public static final int STATUS_CONNECT_IO_ERROR
Failed to communicate with a connected remote endpoint.If this error occurs frequently, disconnect from the remote endpoint and reconnect to it.
Constant value: 8011

Constant
public static final int STATUS_ENDPOINT_UNKNOWN
Attempting to connect to an unknown remote endpoint. The endpoint has not been discovered or connected to other devices yet.
Constant value: 8012

Constant
public static final int STATUS_API_OCCUPIED
Nearby API has been already called by another app, and is unavailable now.
Constant value: 8013

Constant
public static final int STATUS_MISSING_PERMISSION_ACCESS_COARSE_LOCATION
The ACCESS_COARSE_LOCATION permission is required.
Constant value: 8014

Constant
public static final int STATUS_MISSING_PERMISSION_ACCESS_WIFI_STATE
The ACCESS_WIFI_STATE permission is required.
Constant value: 8015

Constant
public static final int STATUS_MISSING_PERMISSION_BLUETOOTH
The BLUETOOTH permission is required.
Constant value: 8016

Constant
public static final int STATUS_MISSING_PERMISSION_BLUETOOTH_ADMIN
The BLUETOOTH_ADMIN permission is required.
Constant value: 8017

Constant
public static final int STATUS_MISSING_PERMISSION_CHANGE_WIFI_STATE
The CHANGE_WIFI_STATE permission is required.
Constant value: 8018

Constant
public static final int STATUS_MISSING_PERMISSION_RECORD_AUDIO
The RECORD_AUDIO permission is required.
Constant value: 8019

Constant
public static final int STATUS_MISSING_SETTING_LOCATION_ON
The location permission must be enabled.
Constant value: 8020

Constant
public static final int STATUS_MESSAGE_APP_UNREGISTERED
The user has not granted the permission to call the Message API.
Constant value: 8050

Constant
public static final int STATUS_MESSAGE_APP_QUOTA_LIMITED
The app has reached its quota limit to call Nearby Message APIs. You can increase your quota limit.
Constant value: 8051

Constant
public static final int STATUS_MESSAGE_BLE_BROADCASTING_UNSUPPORTED
The Message API is called to perform an operation that requires BLE broadcasting, but this function is not supported.
Constant value: 8052

Constant
public static final int STATUS_MESSAGE_BLE_SCANNING_UNSUPPORTED
The Message API is called to perform an operation that requires BLE scanning, but this function is not supported.
Constant value: 8053

Constant
public static final int STATUS_MESSAGE_BLUETOOTH_OFF
The Bluetooth function needs to be turned on for calling the Message API.
Constant value: 8054

Constant
public static final int STATUS_MESSAGE_WRONG_CONTEXT
The context of the Message API is invalid.
Constant value: 8055

Constant
public static final int STATUS_MESSAGE_NOT_ALLOW
The Message API is disabled.
Constant value: 8056

Constant
public static final int STATUS_MESSAGE_MISSING_PERMISSIONS
The request for calling the Message API is rejected due to insufficient permissions.
Constant value: 8057

Constant
public static final int STATUS_MESSAGE_AUTH_FAILED
The Message API is not authorized.
Constant value: 8058

Constant
public static final int STATUS_MESSAGEPENDING_INTENTS_LIMITED
The number of message subscriptions initiated by the app has exceeded the upper limit allowed by PendingIntent. Before initiating a new subscription, delete existing subscriptions.
Constant value: 8059

Public Methods

Method
public static String getStatusCode(int statusCode)
Returns a character string based on a specified result code.

Parameters

Parameter nameParameter desc
statusCodeResult code.