Class BitwardsService

java.lang.Object
fi.bitwards.service.BitwardsService

public final class BitwardsService extends Object

Bitwards SDK for Android

Introduction

The BitwardsService class is the main class of Bitwards SDK through which the main function SDK are used. The main functions of Bitwards SDK are:

  • initialization of SDK and login/logout of end user
  • synchronization of SDK data
  • scanning for Bluetooth Low Energy (BLE) based resources
  • accessing resources, both BLE and NFC based resources
  • getting list of known resources to the end user, and user profile data

In the following chapters we discuss these main functions in more detail.

Most of the operations offered by Bitwards SDK are asynchronous, i.e., an operation is triggered by a method and results of the operation are provided back with a callback functions. It is recommended, that all the Bitwards SDK methods are called using the main thread (UI thread) of the application. All callbacks are executed in the main thread.

NOTE: All documentation assumes that the developer is familiar with Android development.

Bitwards SDK setup

The instructions how to setup an Android Studio project to use Bitwards SDK can be found here: Bitwards SDK setup.

Initialize SDK and login end user

Bitwards SDK is intialized by obtaining a BitwardsService instance. BitwardsService instance is a singleton, i.e., the BitwardsService instance is always returned by this method.

IMPORTANT: Before attempting to initialize BitwardsService instance, the following must be checked:

  • Application running on a device with Android 11 or older (Android SDK 30 or lower) must have ACCESS_FINE_LOCATION and the permission must be requested from the end user during run time. To setup the application with location permissions, please refer to Request location permissions documentation for details.
  • Application running on a device with Android 12 or newer (Android SDK 31 or higher) must have BLUETOOTH_SCAN and BLUETOOTH_CONNECT, and the permission must be requested from the end user during run time. To setup the application with Bluetooth permissions, please refer to Bluetooth permissions documentation for details.

If the end user has not granted ACCESS_FINE_LOCATION permission in Android SDK version 30 or lower or BLUETOOTH_SCAN and BLUETOOTH_CONNECT permissions in Android SDK version 31 or higher, calling BitwardsService.getInstance(..) will throw a BitwardsException. Application must check if these permission have been granted by the end user and if not, request end user to grant them. It is recommended that application always checks these permissions during application startup as newer versions of Android may remove permissions from applications if they haven't been used for awhile.

Note: The requirement that device lock must be enabled in the device has been removed from the Bitwards SDK.


     String license = "contains license that is obtained from Bitwards (currently not used)";

     // Get BitwardsService instance which is singleton:
     BitwardsService bws = BitwardsService.getInstance(context.getApplicationContext(),license);
 

BitwardsService instance cannot really be used for anything until and an end user is logged in with the BitwardsService instance. This can be done either by loggging in with a username and password, or an OAuth2 authentication token, if configuration allows it.


     // Create credential with username and password (if username/password is used)
     BitwardsCredential passwordCredential = new BitwardsCredential.Builder(BitwardsCredential.TYPE_USERNAME_PASSWORD)
         .setUsername(USERNAME)
         .setPassword(PASSWORD)
         .build();

     // Create credential with OAuth2 (if OAuth2 token is used)
     BitwardsCredential oauth2Credential = new BitwardsCredential.Builder(BitwardsCredential.TYPE_OAUTH2_AUTH_TOKEN)
         .setAuthenticationToken(AUTH_TOKEN)
         .setAuthenticationDomain(AUTH_DOMAIN)
         .build();

     // Login with credential (this time OAuth2)
     bws.login(oauth2Credential, new BitwardsService.ResultCallback() {
         @Override
         public void onSuccess() {
             // Login was successful
         }

         @Override
         public void onError(int errorCode) {
             // Login failed
         }
     });
 

Setup callback for NFC based resources

Bitwards SDK can access resources via NFC. The opening over NFC will happen automatically, but if the application wants to receive a notifications for these events, it must setup the NFCResourceCallback.


     // Setup callback for NFC based resources
     bws.setNFCResourceCallback(new BitwardsService.NFCResourceCallback() {
         @Override
         public void onAccessGranted(BitwardsResource resource) {
             // Access to a NFC based resource was granted
         }

         @Override
         public void onAccessDenied(BitwardsResource resource, int reasonCode) {
             // Access to a NFC based resource was denied
         }

         @Override
         public void onError(BitwardsResource resource, int errorCode) {
             // An error occurred when accessing a NFC based resoruce
         }
     });
 

Synchronize with backend server

Bitwards SDK must be synchronized periodically with the backend server to have all the data up to date. The SDK does synchronize automatically every 8 hours, but if the application wants to make sure that the data (e.g., known resource list) is refreshed, do synchronization.


     // Synchronize Bitwards SDK's database with the backend server
     bws.synchronize(new BitwardsService.ResultCallback() {
         @Override
         public void onSuccess() {
             // Synchronization with the backend server was successful
         }

         @Override
         public void onError(int errorCode) {
             // Synchronization failed
         }
     });
 

Get known resource list

The known resource list is the list of resources that the end user either has access currently, or will have access in the future. The BitwardsResource instance can be used with accessResource(..) method to access the resource (e.g., open the resource).


     // Obtain the known resource list
     List<BitwardsResource> list = bws.getBitwardsResourceList();
 

Register/unregister for discovering resources nearby

The background scan can be used to discover nearby Bluetooth based resources (i.e., BLE resources). When a BackgroundScanCallback instance is registered with the Bitwards SDK, the given methods is used to indicate a resource nearby or that a resource has been lost (i.e., is not nearby anymore). The onResourceFound(..) callback is called approximately once a second per resource when it is nearby (i.e., the device where the application is running is able to Bluetooth advertisement messages from the resource).


     // Instantiate BackgroundScanCallback instance
     BitwardsService.BackgroundScanCallback callback = new BitwardsService.BackgroundScanCallback() {
         @Override
         public void onResourceFound(BitwardsResource resource) {
             // a resource was found, is called multiple times; about once a second per nearby resource

             // For instance, to obtain the Bluetooth signal strength (RSSI):
             int rssi = resource.getRSSI();
             // rssi value is typically between -30 to -99, where
             // -30 means signal is strong (resource is relatively close), and
             // -70 means signal is weak (resource is quite far away).
         }

         @Override
         public void onResourceLost(BitwardsResource resource) {
             // a previously found resource is not any more nearby
         }

         @Override
         public void onError(int errorCode) {
             // an error occurred during background scan; scan is stopped
         }
     };

     // Register callback with BitwardsService for background scan callbacks
     bws.registerBackgroundScanCallback(callback);

     // Unregister callback when you are done with background scan callbacks
     bws.unregisterBackgroundScanCallback(callback);
 

Access a resource

To access a resource (e.g., opening it) is executed with call to accessResource(..) method. Best practise is that the application first discovers nearby resources with the background scan callback, and then populates a list of available resources in the application UI. The end user then taps one of the available resources, which triggers calling of the accessResource(..) method with the indicates BitwardsResource instance.


     // Accessing (e.g., opening) a particular resource
     bws.accessResource(resource, new BitwardsService.BLEResourceCallback() {
         @Override
         public void onSelectResource(List<BitwardsResource> resources, BitwardsService.SelectResourceCallback callback) {
             // In this case (i.e., resource was already indicated in the method call),
             // this is not gonna be called because we are accessing directly the particular resource.
         }

         @Override
         public void onResourceNotFound(BitwardsResource resource) {
             // The BLE based resource was not found, i.e., it is not nearby.
         }

         @Override
         public void onAccessGranted(BitwardsResource resource) {
             // Access was granted to the BLE based resource.
         }

         @Override
         public void onAccessDenied(BitwardsResource resource, int reasonCode) {
             // Access was denied to the BLE based resource.
         }

         @Override
         public void onError(BitwardsResource resource, int errorCode) {
             // An error occurred while accessing to the BLE based resource.
             // This is happens sometimes.  Application can indicate the error
             // in the UI, and the end user can try to access the resource again.
         }
     });
 

Discover and access a selected resource

This is one method call that does both the discovery (scans of known resources) as well as access a resource that was selected. Essentially, this is the same as using the background scan callback with access a discovered resource. The functionality is that first a two second bluetooth scan is performed. Second, a list of discovered known resources are returned with toSelectResource(..) callback. Third, a resource can be selected to be accessed and it is indicated with the SelectResourceCallback interface. Finally, the selected resource is accessed as before.


     // Scanning for any available known resource and access the selected one (discover invalid input: '&' access)
     bws.discoverAndAccessResource(new BitwardsService.BLEResourceCallback() {
         @Override
         public void onSelectResource(List<BitwardsResource> resources, BitwardsService.SelectResourceCallback callback) {
             // Select among the discovered BLE based resources which one to open,
             // resource with strongest bluetooth signal is first in the list

             // As an example, we are going to select the resource with
             // strongest bluetooth signal (i.e., first resource on the list)
             callback.selectedResource(resources.get(0));
         }

         @Override
         public void onResourceNotFound(BitwardsResource resource) {
             // No resources were found during the scan phase.
         }

         @Override
         public void onAccessGranted(BitwardsResource resource) {
             // Access was granted for the selected resource
         }

         @Override
         public void onAccessDenied(BitwardsResource resource, int reasonCode) {
             // Access was denied for the selected resource
         }

         @Override
         public void onError(BitwardsResource resource, int errorCode) {
             // An error occurred while accessing the selected resource.
         }
     });
 

Logout end user

BitwardsService instance can be logged out from the backend server at anytime. After this, resources cannot be accessed anymore. BitwardsService must be logged back in in order to perform operations with resources.


     // Logout from backend server
     bws.logout(new BitwardsService.ResultCallback() {
         @Override
         public void onSuccess() {
             // Logout with the backend server was successful
         }

         @Override
         public void onError(int errorCode) {
             // Logout failed
         }
     });
 

Utility functions

Enable error reporting

Bitwards SDK is capable of reporting error back to Bitwards servers, but this needs to be setup when application launches. Bitwards SDK uses ACRA for error reporting. All error reports are sent silently, i.e., end user will not notice this.

ACRA is setup the following way:


     BitwardsService.Debug.initializeACRA(context, BuildConfig.class);
 

Application can also configure Bitwards SDK to do deeper diagnostics, which means Bitwards SDK sends error reports more frequently. The diagnostics is enabled the following way:


     bws.setBitwardsConfig(new BitwardsConfig.Builder()
         .setBoolean(BitwardsConfig.DIAGNOTICS_ENABLED, true)
         .setOverWrite(true)
         .build());
 

Error code to error string

Bitwards SDK has a lot of error codes. In order to get the textual representation for debugging purposes (and printed to logcat, for instance), the developer can use the following.


     // The error code returned by Bitwards SDK (example)
     int errorCode = 0;
     // The error string representing the error code
     String errorText = BitwardsService.Debug.getErrorString(errorCode);
     // See more about the error code / string from Bitwards SDK javadoc
 

Getting error code from BitwardsException

The Bitwards error code can be obtained from Bitwards exception as follows:


     try {
         ...
     } catch (BitwardsException be) {
         int errorCode = be.getErrorCode();
         // process the error code
     }
 
  • Field Details

    • RESOURCE_SCAN_MODE_FULL

      public static final int RESOURCE_SCAN_MODE_FULL
      Bluetooth scan mode: scan for Bitwards resources will report all found resources, including unknown ones.
      See Also:
    • RESOURCE_SCAN_MODE_KNOWN

      public static final int RESOURCE_SCAN_MODE_KNOWN
      Bluetooth scan mode: scan for Bitwards resources will report only regular resources known by the logged in Bitwards end user.
      See Also:
    • RESOURCE_SCAN_MODE_UNIVERSAL

      public static final int RESOURCE_SCAN_MODE_UNIVERSAL
      Bluetooth scan mode: scan for Bitwards resources will report only universal resources known by the logged in Bitwards end user.
      See Also:
    • ERROR_BLUETOOTH_NO_PERMISSION

      public static final int ERROR_BLUETOOTH_NO_PERMISSION
      Bitwards resource error: Application does not have permission to use Bluetooth (needs access to permission).
      See Also:
    • ERROR_BLUETOOTH_NOT_ENABLED

      public static final int ERROR_BLUETOOTH_NOT_ENABLED
      Bitwards resource error: Bluetooth is not on in the device.
      See Also:
    • ERROR_BLE_SCAN_FAILED

      public static final int ERROR_BLE_SCAN_FAILED
      Bitwards resource error: Bluetooth scan failed.
      See Also:
    • ERROR_BAD_RESOURCE

      public static final int ERROR_BAD_RESOURCE
      Bitwards resource error: Resource is malfunctioning.
      See Also:
    • ERROR_GATT_ERROR

      public static final int ERROR_GATT_ERROR
      Bitwards resource error: Bluetooth GATT error occurred (try again).
      See Also:
    • ERROR_DEVICE_CONNECTION_ACTIVE

      public static final int ERROR_DEVICE_CONNECTION_ACTIVE
      Bitwards resource error: Bluetooth connection is already active.
      See Also:
    • ERROR_BLE_SCAN_ALREADY_ACTIVE

      public static final int ERROR_BLE_SCAN_ALREADY_ACTIVE
      Bitward resource error: Bluetooth scan is already active.
      See Also:
    • ERROR_BLE_NOT_RESOURCE

      public static final int ERROR_BLE_NOT_RESOURCE
      Bitwards resource error: Accessed bluetooth device is not a resource.
      See Also:
    • ERROR_NFC_NO_PERMISSION

      public static final int ERROR_NFC_NO_PERMISSION
      Bitwards resource error: Application does not have NFC permission.
      See Also:
    • ERROR_BLUETOOTH_WAS_DISABLED

      public static final int ERROR_BLUETOOTH_WAS_DISABLED
      Bitwards resource error: Bluetooth was disabled during operation.
      See Also:
    • ERROR_BAD_MAC_ADDRESS

      public static final int ERROR_BAD_MAC_ADDRESS
      Bitwards resource error: Bluetooth MAC address was invalid.
      See Also:
    • ERROR_RESOURCE_OUT_OF_RANGE

      public static final int ERROR_RESOURCE_OUT_OF_RANGE
      Bitwards resource error: resource was moved out of range.
      See Also:
    • ERROR_RESOURCE_DISCONNECTED

      public static final int ERROR_RESOURCE_DISCONNECTED
      Bitwards resource error: resource disconnected.
      See Also:
    • ERROR_RESOURCE_TIMEOUT

      public static final int ERROR_RESOURCE_TIMEOUT
      Bitwards resource error: connection to resource timed out.
      See Also:
    • ERROR_GATT_READ_FAILURE

      public static final int ERROR_GATT_READ_FAILURE
      Bitwards resource error: GATT characteristic read failure. This error should be treated as ERROR_BAD_RESOURCE.)
      See Also:
    • ERROR_RESOURCE_UNKNOWN_ERROR

      public static final int ERROR_RESOURCE_UNKNOWN_ERROR
      Bitwards resource error: unknown error occurred.
      See Also:
    • ERROR_UNKNOWN

      public static final int ERROR_UNKNOWN
      An unknown error occurred.
      See Also:
    • ERROR_NO_INTERNET

      public static final int ERROR_NO_INTERNET
      Device is not connected to internet.
      See Also:
    • ERROR_NOT_LOGGED_IN

      public static final int ERROR_NOT_LOGGED_IN
      Bitwards end user is not logged in, BitwardsService instanced is not connected to Bitwards backend environment.
      See Also:
    • ERROR_ALREADY_LOGGED_IN

      public static final int ERROR_ALREADY_LOGGED_IN
      Bitwards end user is already logged in, BitwardsService instance is already connected to Bitwards backend environment.
      See Also:
    • ERROR_LOGIN_FAILED

      public static final int ERROR_LOGIN_FAILED
      Login of the Bitwards end user to the Bitwards backend environment failed.
      See Also:
    • ERROR_LOGOUT_FAILED

      public static final int ERROR_LOGOUT_FAILED
      Logout of the logged in Bitwards end user from the Bitwards backend environment failed.
      See Also:
    • ERROR_CHANGE_PASSWORD_FAILED

      public static final int ERROR_CHANGE_PASSWORD_FAILED
      Password change of the logged in Bitwards end user failed.
      See Also:
    • ERROR_GET_USER_PROFILE_FAILED

      public static final int ERROR_GET_USER_PROFILE_FAILED
      Getting the profile of the logged in Bitwards end user failed.
      See Also:
    • ERROR_CHANGE_USER_PROFILE_FAILED

      public static final int ERROR_CHANGE_USER_PROFILE_FAILED
      Changing the profile of the logged in Bitwards end user failed.
      See Also:
    • ERROR_GET_RESOURCE_LIST_FAILED

      public static final int ERROR_GET_RESOURCE_LIST_FAILED
      Get the Bitwards resource list of the logged in Bitwards end user failed.
      See Also:
    • ERROR_INITIALIZATION_FAILED

      public static final int ERROR_INITIALIZATION_FAILED
      Initialization of BitwardsService instance failed.
      See Also:
    • ERROR_NOT_INITIALIZED

      public static final int ERROR_NOT_INITIALIZED
      BitwardsService instance is not initialized.
      See Also:
    • ERROR_ALREADY_INITIALIZED

      public static final int ERROR_ALREADY_INITIALIZED
      BitwardsService instance is already initialized.
      See Also:
    • ERROR_NOT_CONNECTED

      public static final int ERROR_NOT_CONNECTED
      BitwardsService instance is not connected.
      See Also:
    • ERROR_BLE_ALREADY_ACTIVE

      public static final int ERROR_BLE_ALREADY_ACTIVE
      An Bluetooth operation already active.
      See Also:
    • ERROR_LOGIN_FAILED_DUE_TO_SERVER_ERROR

      public static final int ERROR_LOGIN_FAILED_DUE_TO_SERVER_ERROR
      Login failed due to server error.
      See Also:
    • ERROR_CALLBACK_NULL

      public static final int ERROR_CALLBACK_NULL
      Callback is null.
      See Also:
    • ERROR_NO_LOCATION_PERMISSION

      public static final int ERROR_NO_LOCATION_PERMISSION
      Application does not have location permission (ACCESS_FINE_LOCATION).
      See Also:
    • ERROR_NO_NFC_PERMISSION

      public static final int ERROR_NO_NFC_PERMISSION
      Application does not have NFC permission.
      See Also:
    • ERROR_NO_READ_DEVICE_STATE_PERMISSION

      public static final int ERROR_NO_READ_DEVICE_STATE_PERMISSION
      Application does not have READ_DEVICE_STATE permission
      See Also:
    • ERROR_BLUETOOTH_NOT_AVAILABLE

      public static final int ERROR_BLUETOOTH_NOT_AVAILABLE
      Device does not support Bluetooth.
      See Also:
    • ERROR_NFC_NOT_AVAILABLE

      public static final int ERROR_NFC_NOT_AVAILABLE
      Device does not support NFC.
      See Also:
    • ERROR_BLE_SCAN_NOT_ACTIVE

      public static final int ERROR_BLE_SCAN_NOT_ACTIVE
      Bluetooth scan is not active.
      See Also:
    • ERROR_SECURE_DEVICE_LOCK_NOT_ENABLED

      @Deprecated public static final int ERROR_SECURE_DEVICE_LOCK_NOT_ENABLED
      Deprecated.
      Requirement of having device lock enabled has been removed from SDK, hence this error code has been deprecated.
      See Also:
    • ERROR_ANOTHER_OPERATION_ONGOING

      public static final int ERROR_ANOTHER_OPERATION_ONGOING
      Another operation is already ongoing.
      See Also:
    • ERROR_TIMEOUT

      public static final int ERROR_TIMEOUT
      Timeout occurred
      See Also:
    • ERROR_RESOURCE_NULL

      public static final int ERROR_RESOURCE_NULL
      BitwardsResource instance is null
      See Also:
    • ERROR_AUTH_TOKEN_EXPIRED

      public static final int ERROR_AUTH_TOKEN_EXPIRED
      Authentication token with the server has expired, sign in again needed.
      See Also:
    • ERROR_UNKNOWN_BACKGROUND_SCAN_MODE

      public static final int ERROR_UNKNOWN_BACKGROUND_SCAN_MODE
      Unknown background scan mode.
      See Also:
    • ERROR_INSTALLATION_NOT_ACTIVE

      public static final int ERROR_INSTALLATION_NOT_ACTIVE
      Installation is not active.
      See Also:
    • ERROR_INSTALLATION_ACTIVE

      public static final int ERROR_INSTALLATION_ACTIVE
      Installation is active.
      See Also:
    • ERROR_INSTALLATION_FAILED

      public static final int ERROR_INSTALLATION_FAILED
      Installation failed.
      See Also:
    • ERROR_RESOURCE_ALREADY_INSTALLED

      public static final int ERROR_RESOURCE_ALREADY_INSTALLED
      Installation failed because the resoruce was already installed.
      See Also:
    • ERROR_INSTALLATION_TASK_NOT_PENDING

      public static final int ERROR_INSTALLATION_TASK_NOT_PENDING
      Installation task is not in pending mode (it has been already performed)
      See Also:
    • ERROR_WRONG_INSTALLATION_TASK_CANCELLED

      public static final int ERROR_WRONG_INSTALLATION_TASK_CANCELLED
      Installation task to be cancelled was not the active one.
      See Also:
    • ERROR_INSTALLATION_TASK_CANCELLED

      public static final int ERROR_INSTALLATION_TASK_CANCELLED
      Installation task was cancelled
      See Also:
    • ERROR_SERVER_RESPONSE_RESOURCE_ALREADY_INSTALLED

      public static final int ERROR_SERVER_RESPONSE_RESOURCE_ALREADY_INSTALLED
      Installation failed because the Bitwards resource was already installed response by server.
      See Also:
    • ERROR_SERVER_RESPONSE_INTERNAL_ERROR

      public static final int ERROR_SERVER_RESPONSE_INTERNAL_ERROR
      Installation failed because internal error response by server.
      See Also:
    • ERROR_SERVER_RESPONSE_FAILED_TO_ADD_NEW_RESOURCE_IN_SERVER

      public static final int ERROR_SERVER_RESPONSE_FAILED_TO_ADD_NEW_RESOURCE_IN_SERVER
      Installation failed because server failed to new Bitwards resource response by server.
      See Also:
    • ERROR_SERVER_RESPONSE_SERIAL_NUMBER_ALREADY_EXISTS

      public static final int ERROR_SERVER_RESPONSE_SERIAL_NUMBER_ALREADY_EXISTS
      Installation failed because serial number already exists response by server.
      See Also:
    • ERROR_SERVER_RESPONSE_CANCEL_RESOURCE_RESERVATION_FAILED

      public static final int ERROR_SERVER_RESPONSE_CANCEL_RESOURCE_RESERVATION_FAILED
      Cancel Bitwards resource reservation failed response by server.
      See Also:
    • ERROR_CANCEL_RESOURCE_RESERVATION_SERVER_COMMUNICATION

      public static final int ERROR_CANCEL_RESOURCE_RESERVATION_SERVER_COMMUNICATION
      Cancel Bitwards resource reservation server communication error.
      See Also:
    • ERROR_SERVER_RESPONSE_RESOURCE_RESERVATION_FAILED

      public static final int ERROR_SERVER_RESPONSE_RESOURCE_RESERVATION_FAILED
      Bitwards resource reservation failed response by server.
      See Also:
    • ERROR_RESOURCE_RESERVATION_SERVER_COMMUNICATION

      public static final int ERROR_RESOURCE_RESERVATION_SERVER_COMMUNICATION
      Bitwards resource reservation server communication error.
      See Also:
    • ERROR_SERVER_RESPONSE_GET_LOCATION_LIST_FAILED

      public static final int ERROR_SERVER_RESPONSE_GET_LOCATION_LIST_FAILED
      Get location list failed response by server.
      See Also:
    • ERROR_GET_LOCATION_LIST_SERVER_COMMUNICATION

      public static final int ERROR_GET_LOCATION_LIST_SERVER_COMMUNICATION
      Get location list server communication error.
      See Also:
    • ERROR_REFRESH_FAILED

      public static final int ERROR_REFRESH_FAILED
      Refresh connection to server failed.
      See Also:
    • ERROR_INSTALLATION_TEST_FAILED

      public static final int ERROR_INSTALLATION_TEST_FAILED
      Testing access to the installed Bitwards resource failed, but installation was otherwise carried out successfully. All installation messages were delivered successfully, but testing the installation with test token failed.
      See Also:
    • ERROR_LOCATION_SERVICE_DISABLED

      public static final int ERROR_LOCATION_SERVICE_DISABLED
      Android device's Location service is disabled. It needs to be enabled in order to have Bluetooth scanning to work.
      See Also:
    • ERROR_RESOURCE_UPDATE_FAILED

      public static final int ERROR_RESOURCE_UPDATE_FAILED
      Update process of the Bitwards resource failed.
      See Also:
    • ERROR_RESOURCE_UPDATE_ACTIVE

      public static final int ERROR_RESOURCE_UPDATE_ACTIVE
      Another Bitwards resource update process is active.
      See Also:
    • ERROR_RESOURCE_UPDATE_TASK_CANCELLED

      public static final int ERROR_RESOURCE_UPDATE_TASK_CANCELLED
      Bitwards resource update task was cancelled.
      See Also:
    • ERROR_RESOURCE_UPDATE_NOT_ACTIVE

      public static final int ERROR_RESOURCE_UPDATE_NOT_ACTIVE
      Bitwards resource update process is not active.
      See Also:
    • ERROR_WRONG_RESOURCE_UPDATE_TASK_CANCELLED

      public static final int ERROR_WRONG_RESOURCE_UPDATE_TASK_CANCELLED
      Wrong Bitwards resource update task was cancelled.
      See Also:
    • ERROR_BACKGROUND_SCAN_STOPPED

      public static final int ERROR_BACKGROUND_SCAN_STOPPED
      Background scan was stopped manually.
      See Also:
    • ERROR_ACCESS_FORBIDDEN

      public static final int ERROR_ACCESS_FORBIDDEN
      The logged in end user does not have the permission to access the requested service.
      See Also:
    • ERROR_LOGIN_FAILED_BECAUSE_USER_DOES_NOT_EXISTS

      public static final int ERROR_LOGIN_FAILED_BECAUSE_USER_DOES_NOT_EXISTS
      Login failed because user does not exist.
      See Also:
    • ERROR_NO_BLUETOOTH_SCAN_PERMISSION

      public static final int ERROR_NO_BLUETOOTH_SCAN_PERMISSION
      The application does not have the BLUETOOTH_SCAN permission.
      See Also:
    • ERROR_NO_BLUETOOTH_CONNECT_PERMISSION

      public static final int ERROR_NO_BLUETOOTH_CONNECT_PERMISSION
      The application does not have the BLUETOOTH_CONNECT permission.
      See Also:
    • ERROR_ACCOUNT_DELETION_FAILED

      public static final int ERROR_ACCOUNT_DELETION_FAILED
      The application does not have the BLUETOOTH_CONNECT permission.
      See Also:
    • REASON_BAD_DATA

      public static final int REASON_BAD_DATA
      Operation with Bitwards resource failed: bad data.
    • REASON_WRONG_SIGNATURE

      public static final int REASON_WRONG_SIGNATURE
      Operation with Bitwards resource failed: bad signature.
    • REASON_WRONG_DELEGATION

      public static final int REASON_WRONG_DELEGATION
      Operation with Bitwards resource failed: wrong delegation.
    • REASON_DELEGATION_USED

      public static final int REASON_DELEGATION_USED
      Operation with Bitwards resource failed: delegation used.
    • REASON_DELEGATION_CACHE_OVERRUN

      public static final int REASON_DELEGATION_CACHE_OVERRUN
      Operation with Bitwards resource failed: delegation cache overrun.
    • REASON_TOKEN_BLACKLISTED

      public static final int REASON_TOKEN_BLACKLISTED
      Operation with Bitwards resource failed: token is blacklisted.
    • REASON_WRONG_TIME_WINDOW

      public static final int REASON_WRONG_TIME_WINDOW
      Operation with Bitwards resource failed: token has wrong time window.
    • REASON_CREATIONTIME_IN_FUTURE

      public static final int REASON_CREATIONTIME_IN_FUTURE
      Operation with Bitwards resource failed: token creation time in future.
    • REASON_RESOURCE_ALREADY_RESERVED

      public static final int REASON_RESOURCE_ALREADY_RESERVED
      Operation with Bitwards resource failed: resource is already reserved.
    • REASON_ILLEGAL_USER_ROLE

      public static final int REASON_ILLEGAL_USER_ROLE
      Operation with Bitwards resource failed: token owner has illegal user role.
    • REASON_PERIPHERAL_FAILURE

      public static final int REASON_PERIPHERAL_FAILURE
      Operation with Bitwards resource failed: peripheral failure occurred.
    • REASON_PERIPHERAL_COMMUNICATION_FAILURE

      public static final int REASON_PERIPHERAL_COMMUNICATION_FAILURE
      Operation with Bitwards resource failed: peripheral communication failure occurred.
    • REASON_OPERATION_FAILED_BATTERY_CRITICAL

      public static final int REASON_OPERATION_FAILED_BATTERY_CRITICAL
      Operation with Bitwards resource failed: operation failed due to resource's battery being critical.
    • REASON_OPERATION_DENIED_BY_REGULAR_SCHEDULE

      public static final int REASON_OPERATION_DENIED_BY_REGULAR_SCHEDULE
      Operation with Bitwards resource failed: access denied due to regular schedule access list.
    • REASON_OPERATION_DENIED_BY_EXCEPTION_SCHEDULE

      public static final int REASON_OPERATION_DENIED_BY_EXCEPTION_SCHEDULE
      Operation with Bitwards resource failed: access denied due to exception schedule.
    • REASON_NO_VALID_TOKEN

      public static final int REASON_NO_VALID_TOKEN
      Operation with Bitwards resource failed: application does not have have a valid token for the resource.
    • ERROR_RESOURCE_REQUIRES_APP_UPDATE

      public static final int ERROR_RESOURCE_REQUIRES_APP_UPDATE
      Operation with Bitwards resource failed: application does not support the protocol resource is using, application update is required.
  • Method Details