| CLASS info |
| public final class StatusCode |
| Represents a Nearby operation result code. |
| Type | Name | Desc |
| int | STATUS_SUCCESS | Operation succeeded. |
| int | STATUS_FAILURE | Operation failed. |
| int | STATUS_API_DISORDER | API calls are out of order. |
| int | STATUS_NO_NETWORK | The local endpoint is not connected to the Wi-Fi or Ethernet. |
| int | STATUS_NOT_CONNECTED | The remote endpoint is not connected, and data cannot be sent to it. |
| int | STATUS_TRANSFER_IO_ERROR | Failed to read or write a file or data streams. |
| int | STATUS_ALREADY_BROADCASTING | The app is broadcasting. Stop the broadcasting before broadcasting again. |
| int | STATUS_ALREADY_CONNECTED | The app is already connected to the same remote endpoint. |
| int | STATUS_ALREADY_SCANNING | The app is scanning for nearby devices. Stop the scanning before scanning again. |
| int | STATUS_POLICY_CONFLICT | A policy is used by the ongoing scanning and connection. Stop the scanning and connection before enabling a new policy. |
| int | STATUS_BLUETOOTH_OPERATION_FAILED | The connection failed due to a Bluetooth error. |
| int | STATUS_CONNECT_REJECTED | The remote endpoint rejected the connection. |
| 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. |
| int | STATUS_ENDPOINT_UNKNOWN | Attempting to connect to an unknown remote endpoint. The endpoint has not been discovered or connected to other devices yet. |
| int | STATUS_API_OCCUPIED | Nearby API has been already called by another app, and is unavailable now. |
| int | STATUS_MISSING_PERMISSION_ACCESS_COARSE_LOCATION | The ACCESS_COARSE_LOCATION permission is required. |
| int | STATUS_MISSING_PERMISSION_ACCESS_WIFI_STATE | The ACCESS_WIFI_STATE permission is required. |
| int | STATUS_MISSING_PERMISSION_BLUETOOTH | The BLUETOOTH permission is required. |
| int | STATUS_MISSING_PERMISSION_BLUETOOTH_ADMIN | The BLUETOOTH_ADMIN permission is required. |
| int | STATUS_MISSING_PERMISSION_CHANGE_WIFI_STATE | The CHANGE_WIFI_STATE permission is required. |
| int | STATUS_MISSING_PERMISSION_RECORD_AUDIO | The RECORD_AUDIO permission is required. |
| int | STATUS_MISSING_SETTING_LOCATION_ON | The location permission must be enabled. |
| int | STATUS_MESSAGE_APP_UNREGISTERED | The user has not granted the permission to call the Message API. |
| int | STATUS_MESSAGE_APP_QUOTA_LIMITED | The app has reached its quota limit to call Nearby Message APIs. You can increase your quota limit. |
| 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. |
| 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. |
| int | STATUS_MESSAGE_BLUETOOTH_OFF | The Bluetooth function needs to be turned on for calling the Message API. |
| int | STATUS_MESSAGE_WRONG_CONTEXT | The context of the Message API is invalid. |
| int | STATUS_MESSAGE_NOT_ALLOW | The Message API is disabled. |
| int | STATUS_MESSAGE_MISSING_PERMISSIONS | The request for calling the Message API is rejected due to insufficient permissions. |
| int | STATUS_MESSAGE_AUTH_FAILED | The Message API is not authorized. |
| 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. |
| Return type | Method name |
| String | getStatusCode(int statusCode) Returns a character string based on a specified result code. |
| 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_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_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 |
| Method |
| public static String getStatusCode(int statusCode) |
| Returns a character string based on a specified result code. |
Parameters
| Parameter name | Parameter desc |
| statusCode | Result code. |