diff --git a/README.md b/README.md index a0e299ae..d9bca8dd 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ There are 4 different solutions how to use the manager shown in different profil A better implementation may be found in CSC, RSC, HTM and CGM. The BleManager instance is maintained by the running service. The service is started in order to connect to a device and stopped when user decides to disconnect from it. When an activity is destroyed it unbinds from the service, but the service is still running, so the incoming data may continue to be handled. All device-related data are kept be the service and may be obtained by a new activity when it binds to it in order to be shown to the user. -As a third, the Proximity profile allows to connect to multiple sensors at the same time. It uses a different service implementation but still the BleManager is used to manage each connection. If the [shouldAutoConnect()](hhttps://github.com/NordicSemiconductor/Android-BLE-Library/blob/master/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java#L246) method returns true for a connection, the manager will try to reconnect automatically to the device if a link was lost. You will also be notified about a device that got away using ```onLinklossOccur(BluetoothDevice)```. +As a third, the Proximity profile allows to connect to multiple sensors at the same time. It uses a different service implementation but still the BleManager is used to manage each connection. If the [shouldAutoConnect()](hhttps://github.com/NordicSemiconductor/Android-BLE-Library/blob/master/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java#L246) method returns true for a connection, the manager will try to reconnect automatically to the device if a link was lost. You will also be notified about a device that got away using ```onLinklossOccurred(BluetoothDevice)```. The BleMulticonnectProfileService implementation, used by Proximity profile, does not save addresses of connected devices. When the service is killed it will not be able to reconnect to them after it's restarted, so this feature has been disabled. Also, when user removes the nRF Toolbox app from Recents, the service will be killed and all devices will be disconnected automatically. To change this behaviour a service would have to either save the addresses and reconnect to devices after it has restarted (but then removing the app from Recents would cause disconnection and immediate reconnection as the service is then killed and moved to another process), or would have to be implemented in a way that is using another [process](https://developer.android.com/guide/topics/manifest/service-element.html#proc). Then, however, it is not possible to bind to such service and data must be exchanged using a [Messenger](https://developer.android.com/reference/android/app/Service.html#RemoteMessengerServiceSample). Such approach is not demonstrated in nRF Toolbox. @@ -91,7 +91,7 @@ To open the DFU settings click the *Settings* button in the top toolbar when on **MBR size** - This value is used only to convert HEX files into BIN files. If your packet is already in the BIN format, this value is ignored. The data from addresses lower then this value are being skipped while converting HEX to BIN. This is to prevent from sending the MBR (Master Boot Record) part from the HEX file that contains the Soft Device. The compiled Soft Device contains data that starts at address 0x0000 and contains the MBR. It is followed by the jump to address 0x1000 (default MBR size) where the Soft Device firmware starts. Only the Soft Device part must be sent over DFU. -**Keep bond information** - When upgrading the application on a bonded device the DFU bootloader may be configured to preserve some pages of the application's memory intact, so that the new application may read them. The new application must know the old data format in order to read them correctly. Our HRS DFU sample stores the Long Term Key (LTK) and the Service Attributes in two first pages. However, the DFU Bootloader, by default, clears the whole application's memory when the new application upload completes, and the bond information is lost. In order to configure the number of pages to be preserved set the **DFU_APP_DATA_RESERVED** value in the *dfu_types.h* file in the DFU bootloader code (line ~56). To preserve two pages the value should be set to 0x0800. When your DFU bootloader has been modified to keep the bond information after updating the application set the switch to ON. Otherwise the bond information will be removed from the phone. +**Keep bond information** - When upgrading the application on a bound device the DFU bootloader may be configured to preserve some pages of the application's memory intact, so that the new application may read them. The new application must know the old data format in order to read them correctly. Our HRS DFU sample stores the Long Term Key (LTK) and the Service Attributes in two first pages. However, the DFU Bootloader, by default, clears the whole application's memory when the new application upload completes, and the bond information is lost. In order to configure the number of pages to be preserved set the **DFU_APP_DATA_RESERVED** value in the *dfu_types.h* file in the DFU bootloader code (line ~56). To preserve two pages the value should be set to 0x0800. When your DFU bootloader has been modified to keep the bond information after updating the application set the switch to ON. Otherwise the bond information will be removed from the phone. **External MCU DFU** - The DFU service from the library, when connected to a DFU target, will check whether it is in application or in DFU bootloader mode. For DFU implementations from SDK 7.0 or newer this is done by reading the value of DFU Version characteristic. If the returned value is equal to 0x0100 (major = 0, minor = 1) it means that we are in the application mode and jump to the bootloader mode is required. diff --git a/app/src/main/java/no/nordicsemi/android/nrftoolbox/cgms/CGMSActivity.java b/app/src/main/java/no/nordicsemi/android/nrftoolbox/cgms/CGMSActivity.java index f11e0b99..2a0faf61 100644 --- a/app/src/main/java/no/nordicsemi/android/nrftoolbox/cgms/CGMSActivity.java +++ b/app/src/main/java/no/nordicsemi/android/nrftoolbox/cgms/CGMSActivity.java @@ -115,7 +115,7 @@ public class CGMSActivity extends BleProfileServiceReadyActivity cgmsRecords = binder.getRecords(); if (cgmsRecords != null && cgmsRecords.size() > 0) { @@ -128,7 +128,7 @@ public class CGMSActivity extends BleProfileServiceReadyActivity mBleManager; private Handler mHandler; - protected boolean mBinded; + protected boolean mBound; private boolean mActivityIsChangingConfiguration; private BluetoothDevice mBluetoothDevice; private String mDeviceName; @@ -234,13 +234,13 @@ public abstract class BleProfileService extends Service implements BleManagerCal @Override public IBinder onBind(final Intent intent) { - mBinded = true; + mBound = true; return getBinder(); } @Override public final void onRebind(final Intent intent) { - mBinded = true; + mBound = true; if (!mActivityIsChangingConfiguration) onRebind(); @@ -257,7 +257,7 @@ public abstract class BleProfileService extends Service implements BleManagerCal @Override public final boolean onUnbind(final Intent intent) { - mBinded = false; + mBound = false; if (!mActivityIsChangingConfiguration) onUnbind(); @@ -424,7 +424,7 @@ public abstract class BleProfileService extends Service implements BleManagerCal // Note 2: if BleManager#shouldAutoConnect() for this device returned true, this callback will be // invoked ONLY when user requested disconnection (using Disconnect button). If the device - // disconnects due to a link loss, the onLinklossOccur(BluetoothDevice) method will be called instead. + // disconnects due to a link loss, the onLinklossOccurred(BluetoothDevice) method will be called instead. final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE); broadcast.putExtra(EXTRA_DEVICE, mBluetoothDevice); @@ -442,7 +442,7 @@ public abstract class BleProfileService extends Service implements BleManagerCal } @Override - public void onLinklossOccur(final BluetoothDevice device) { + public void onLinklossOccurred(final BluetoothDevice device) { final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE); broadcast.putExtra(EXTRA_DEVICE, mBluetoothDevice); broadcast.putExtra(EXTRA_CONNECTION_STATE, STATE_LINK_LOSS); @@ -495,7 +495,7 @@ public abstract class BleProfileService extends Service implements BleManagerCal } @Override - public void onBonded(final BluetoothDevice device) { + public void onBound(final BluetoothDevice device) { showToast(no.nordicsemi.android.nrftoolbox.common.R.string.bonded); final Intent broadcast = new Intent(BROADCAST_BOND_STATE); diff --git a/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleProfileServiceReadyActivity.java b/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleProfileServiceReadyActivity.java index 5e14e988..1c6fc889 100644 --- a/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleProfileServiceReadyActivity.java +++ b/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/BleProfileServiceReadyActivity.java @@ -112,7 +112,7 @@ public abstract class BleProfileServiceReadyActivity mManagedDevices; private Handler mHandler; - protected boolean mBinded; + protected boolean mBound; private boolean mActivityIsChangingConfiguration; private final BroadcastReceiver mBluetoothStateBroadcastReceiver = new BroadcastReceiver() { @@ -251,13 +251,13 @@ public abstract class BleMulticonnectProfileService extends Service implements B @Override public IBinder onBind(final Intent intent) { - mBinded = true; + mBound = true; return getBinder(); } @Override public final void onRebind(final Intent intent) { - mBinded = true; + mBound = true; if (!mActivityIsChangingConfiguration) { onRebind(); @@ -275,7 +275,7 @@ public abstract class BleMulticonnectProfileService extends Service implements B @Override public final boolean onUnbind(final Intent intent) { - mBinded = false; + mBound = false; if (!mActivityIsChangingConfiguration) { if (!mManagedDevices.isEmpty()) { @@ -435,7 +435,7 @@ public abstract class BleMulticonnectProfileService extends Service implements B public void onDeviceDisconnected(final BluetoothDevice device) { // Note: if BleManager#shouldAutoConnect() for this device returned true, this callback will be // invoked ONLY when user requested disconnection (using Disconnect button). If the device - // disconnects due to a link loss, the onLinklossOccur(BluetoothDevice) method will be called instead. + // disconnects due to a link loss, the onLinklossOccurred(BluetoothDevice) method will be called instead. // We no longer want to keep the device in the service mManagedDevices.remove(device); @@ -449,13 +449,13 @@ public abstract class BleMulticonnectProfileService extends Service implements B LocalBroadcastManager.getInstance(this).sendBroadcast(broadcast); // When user disconnected the last device while the activity was not bound the service can be stopped - if (!mBinded && mManagedDevices.isEmpty()) { + if (!mBound && mManagedDevices.isEmpty()) { stopSelf(); } } @Override - public void onLinklossOccur(final BluetoothDevice device) { + public void onLinklossOccurred(final BluetoothDevice device) { final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE); broadcast.putExtra(EXTRA_DEVICE, device); broadcast.putExtra(EXTRA_CONNECTION_STATE, STATE_LINK_LOSS); @@ -512,7 +512,7 @@ public abstract class BleMulticonnectProfileService extends Service implements B } @Override - public void onBonded(final BluetoothDevice device) { + public void onBound(final BluetoothDevice device) { showToast(no.nordicsemi.android.nrftoolbox.common.R.string.bonded); final Intent broadcast = new Intent(BROADCAST_BOND_STATE); diff --git a/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/multiconnect/BleMulticonnectProfileServiceReadyActivity.java b/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/multiconnect/BleMulticonnectProfileServiceReadyActivity.java index 792dca7f..e75b0372 100644 --- a/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/multiconnect/BleMulticonnectProfileServiceReadyActivity.java +++ b/app/src/main/java/no/nordicsemi/android/nrftoolbox/profile/multiconnect/BleMulticonnectProfileServiceReadyActivity.java @@ -99,7 +99,7 @@ public abstract class BleMulticonnectProfileServiceReadyActivitynull, f.e. Sony Xperia Z1 (C6903) with Android 4.3. The name has to - * be parsed manually form the Advertisement packet. + * the device name. Unfortunately on some devices {@link BluetoothDevice#getName()} + * always returns null, i.e. Sony Xperia Z1 (C6903) with Android 4.3. + * The name has to be parsed manually form the Advertisement packet. */ void onDeviceSelected(final BluetoothDevice device, final String name); @@ -129,12 +132,14 @@ public class ScannerFragment extends DialogFragment { super.onCreate(savedInstanceState); final Bundle args = getArguments(); - if (args.containsKey(PARAM_UUID)) { + if (args != null && args.containsKey(PARAM_UUID)) { mUuid = args.getParcelable(PARAM_UUID); } - final BluetoothManager manager = (BluetoothManager) getActivity().getSystemService(Context.BLUETOOTH_SERVICE); - mBluetoothAdapter = manager.getAdapter(); + final BluetoothManager manager = (BluetoothManager) requireContext().getSystemService(Context.BLUETOOTH_SERVICE); + if (manager != null) { + mBluetoothAdapter = manager.getAdapter(); + } } @Override @@ -146,7 +151,7 @@ public class ScannerFragment extends DialogFragment { @NonNull @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { - final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + final AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()); final View dialogView = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_device_selection, null); final ListView listview = dialogView.findViewById(android.R.id.list); @@ -175,7 +180,7 @@ public class ScannerFragment extends DialogFragment { } }); - addBondedDevices(); + addBoundDevices(); if (savedInstanceState == null) startScan(); return dialog; @@ -205,16 +210,17 @@ public class ScannerFragment extends DialogFragment { } /** - * Scan for 5 seconds and then stop scanning when a BluetoothLE device is found then mLEScanCallback is activated This will perform regular scan for custom BLE Service UUID and then filter out. + * Scan for 5 seconds and then stop scanning when a BluetoothLE device is found then mLEScanCallback + * is activated This will perform regular scan for custom BLE Service UUID and then filter out. * using class ScannerServiceParser */ private void startScan() { // Since Android 6.0 we need to obtain either Manifest.permission.ACCESS_COARSE_LOCATION or Manifest.permission.ACCESS_FINE_LOCATION to be able to scan for // Bluetooth LE devices. This is related to beacons as proximity devices. // On API older than Marshmallow the following code does nothing. - if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { + if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // When user pressed Deny and still wants to use this functionality, show the rationale - if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) && mPermissionRationale.getVisibility() == View.GONE) { + if (ActivityCompat.shouldShowRequestPermissionRationale(requireActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) && mPermissionRationale.getVisibility() == View.GONE) { mPermissionRationale.setVisibility(View.VISIBLE); return; } @@ -276,7 +282,7 @@ public class ScannerFragment extends DialogFragment { } }; - private void addBondedDevices() { + private void addBoundDevices() { final Set devices = mBluetoothAdapter.getBondedDevices(); mAdapter.addBondedDevices(devices); } diff --git a/app/src/main/java/no/nordicsemi/android/nrftoolbox/template/TemplateActivity.java b/app/src/main/java/no/nordicsemi/android/nrftoolbox/template/TemplateActivity.java index 90107569..eef66277 100644 --- a/app/src/main/java/no/nordicsemi/android/nrftoolbox/template/TemplateActivity.java +++ b/app/src/main/java/no/nordicsemi/android/nrftoolbox/template/TemplateActivity.java @@ -80,12 +80,12 @@ public class TemplateActivity extends BleProfileServiceReadyActivity onCreateLoader(final int id, final Bundle args) { switch (id) { - case LOG_REQUEST_ID: { - return new CursorLoader(getActivity(), mLogSession.getSessionEntriesUri(), LOG_PROJECTION, null, null, LogContract.Log.TIME); + case LOG_REQUEST_ID: { + return new CursorLoader(requireContext(), mLogSession.getSessionEntriesUri(), LOG_PROJECTION, null, null, LogContract.Log.TIME); + } } - } - return null; + throw new UnsupportedOperationException("Could not create loader with ID " + id); } @Override - public void onLoadFinished(final Loader loader, final Cursor data) { + public void onLoadFinished(@NonNull final Loader loader, final Cursor data) { // Here we have to restore the old saved scroll position, or scroll to the bottom if before adding new events it was scrolled to the bottom. final ListView list = getListView(); final int position = mLogScrollPosition; @@ -233,7 +242,7 @@ public class UARTLogFragment extends ListFragment implements LoaderManager.Loade } @Override - public void onLoaderReset(final Loader loader) { + public void onLoaderReset(@NonNull final Loader loader) { mLogAdapter.swapCursor(null); } @@ -253,15 +262,17 @@ public class UARTLogFragment extends ListFragment implements LoaderManager.Loade public void onServiceStarted() { // The service has been started, bind to it final Intent service = new Intent(getActivity(), UARTService.class); - getActivity().bindService(service, mServiceConnection, 0); + requireActivity().bindService(service, mServiceConnection, 0); } /** * This method is called when user closes the pane in horizontal orientation. The EditText is no longer visible so we need to close the soft keyboard here. */ public void onFragmentHidden() { - InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); - imm.hideSoftInputFromWindow(mField.getWindowToken(), 0); + final InputMethodManager imm = (InputMethodManager) requireContext().getSystemService(Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.hideSoftInputFromWindow(mField.getWindowToken(), 0); + } } /** diff --git a/app/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTService.java b/app/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTService.java index 2d07af37..be320b10 100644 --- a/app/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTService.java +++ b/app/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTService.java @@ -156,8 +156,8 @@ public class UARTService extends BleProfileService implements UARTManagerCallbac } @Override - public void onLinklossOccur(final BluetoothDevice device) { - super.onLinklossOccur(device); + public void onLinklossOccurred(final BluetoothDevice device) { + super.onLinklossOccurred(device); sendMessageToWearables(Constants.UART.DEVICE_LINKLOSS, notNull(getDeviceName())); } diff --git a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/DevicesAdapter.java b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/DevicesAdapter.java index 188a3759..d91a1f39 100644 --- a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/DevicesAdapter.java +++ b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/DevicesAdapter.java @@ -67,7 +67,7 @@ public class DevicesAdapter extends WearableListView.Adapter { mNotAvailable = context.getString(R.string.not_available); mConnectingText = context.getString(R.string.state_connecting); mAvailableText = context.getString(R.string.devices_list_available); - mBondedText = context.getString(R.string.devices_list_bonded); + mBondedText = context.getString(R.string.devices_list_bound); mBondingText = context.getString(R.string.devices_list_bonding); mListView = listView; mHandler = new Handler(); diff --git a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManager.java b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManager.java index 9c2ed89a..cf54cd79 100644 --- a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManager.java +++ b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManager.java @@ -184,7 +184,7 @@ public class BleManager implements BleProfileApi { * that will be automatically connect as soon as they become available (true). In the latter case, if * Bluetooth adapter is enabled, Android scans periodically for devices from the white list and if a advertising packet * is received from such, it tries to connect to it. When the connection is lost, the system will keep trying to reconnect - * to it in. If true is returned, and the connection to the device is lost the {@link BleManagerCallbacks#onLinklossOccur(BluetoothDevice)} + * to it in. If true is returned, and the connection to the device is lost the {@link BleManagerCallbacks#onLinklossOccurred(BluetoothDevice)} * callback is called instead of {@link BleManagerCallbacks#onDeviceDisconnected(BluetoothDevice)}. *

This feature works much better on newer Android phone models and many not work on older phones.

*

This method should only be used with bonded devices, as otherwise the device may change it's address. @@ -659,7 +659,7 @@ public class BleManager implements BleProfileApi { mCallbacks.onDeviceDisconnected(device); close(); } else { - mCallbacks.onLinklossOccur(device); + mCallbacks.onLinklossOccurred(device); // We are not closing the connection here as the device should try to reconnect automatically. // This may be only called when the shouldAutoConnect() method returned true. } diff --git a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManagerCallbacks.java b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManagerCallbacks.java index 9a513666..57018a82 100644 --- a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManagerCallbacks.java +++ b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleManagerCallbacks.java @@ -72,7 +72,7 @@ public interface BleManagerCallbacks { * Called when the device has disconnected (when the callback returned * {@link BluetoothGattCallback#onConnectionStateChange(BluetoothGatt, int, int)} with state DISCONNECTED), * but ONLY if the {@link BleManager#shouldAutoConnect()} method returned false for this device when it was connecting. - * Otherwise the {@link #onLinklossOccur(BluetoothDevice)} method will be called instead. + * Otherwise the {@link #onLinklossOccurred(BluetoothDevice)} method will be called instead. * @param device the device that got disconnected */ void onDeviceDisconnected(final BluetoothDevice device); @@ -82,7 +82,7 @@ public interface BleManagerCallbacks { * Otherwise a {@link #onDeviceDisconnected(BluetoothDevice)} method will be called on such event. * @param device target device */ - void onLinklossOccur(final BluetoothDevice device); + void onLinklossOccurred(final BluetoothDevice device); /** * Called when an {@link BluetoothGatt#GATT_INSUFFICIENT_AUTHENTICATION} error occurred and the device bond state is NOT_BONDED diff --git a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleProfileService.java b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleProfileService.java index a046ea7d..25eeac17 100644 --- a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleProfileService.java +++ b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/ble/BleProfileService.java @@ -65,7 +65,7 @@ public class BleProfileService extends Service implements BleManagerCallbacks { private BleManager mBleManager; private Handler mHandler; - protected boolean mBinded; + protected boolean mBound; private boolean mConnected; private BluetoothDevice mBluetoothDevice; private String mDeviceName; @@ -157,18 +157,18 @@ public class BleProfileService extends Service implements BleManagerCallbacks { @Override public IBinder onBind(final Intent intent) { - mBinded = true; + mBound = true; return getBinder(); } @Override public final void onRebind(final Intent intent) { - mBinded = true; + mBound = true; } @Override public final boolean onUnbind(final Intent intent) { - mBinded = false; + mBound = false; // We want the onRebind method be called if anything else binds to it again return true; @@ -261,7 +261,7 @@ public class BleProfileService extends Service implements BleManagerCallbacks { @Override public boolean shouldEnableBatteryLevelNotifications(final BluetoothDevice device) { // By default the Battery Level notifications will be enabled only the activity is bound. - return mBinded; + return mBound; } @Override @@ -304,7 +304,7 @@ public class BleProfileService extends Service implements BleManagerCallbacks { } @Override - public void onLinklossOccur(final BluetoothDevice device) { + public void onLinklossOccurred(final BluetoothDevice device) { mConnected = false; final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE); diff --git a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTCommandsActivity.java b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTCommandsActivity.java index 80ccdc6c..9d959e7f 100644 --- a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTCommandsActivity.java +++ b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTCommandsActivity.java @@ -156,7 +156,7 @@ public class UARTCommandsActivity extends Activity implements UARTCommandsAdapte mGoogleApiClient.unregisterConnectionFailedListener(this); mGoogleApiClient = null; - // unbind if we were binded to the service. + // unbind if we were bound to the service. unbindService(mServiceConnection); LocalBroadcastManager.getInstance(this).unregisterReceiver(mServiceBroadcastReceiver); } @@ -219,7 +219,7 @@ public class UARTCommandsActivity extends Activity implements UARTCommandsAdapte @Override public void onMessageReceived(final MessageEvent messageEvent) { - // If the activity is binded to service it means that it has connected directly to the device. We ignore messages from the handheld. + // If the activity is bound to service it means that it has connected directly to the device. We ignore messages from the handheld. if (mProfile != null) return; diff --git a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTConfigurationsActivity.java b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTConfigurationsActivity.java index b8c9dd54..6e3a344c 100644 --- a/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTConfigurationsActivity.java +++ b/wear/src/main/java/no/nordicsemi/android/nrftoolbox/uart/UARTConfigurationsActivity.java @@ -135,7 +135,7 @@ public class UARTConfigurationsActivity extends Activity implements GoogleApiCli mGoogleApiClient.unregisterConnectionFailedListener(this); mGoogleApiClient = null; - // If we were binded to the service, disconnect and unbind. The service will terminate itself when disconnected. + // If we were bound to the service, disconnect and unbind. The service will terminate itself when disconnected. if (mBinder != null) { mBinder.disconnect(); } @@ -182,7 +182,7 @@ public class UARTConfigurationsActivity extends Activity implements GoogleApiCli @Override public void onMessageReceived(final MessageEvent messageEvent) { - // If the activity is binded to service it means that it has connected directly to the device. We ignore messages from the handheld. + // If the activity is bound to service it means that it has connected directly to the device. We ignore messages from the handheld. if (mBinder != null) return; diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index f829ccf1..8044e6e4 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -28,7 +28,7 @@ Scanning for nearby devices… Scan for nearby devices Available - Bonded + Bound Bonding… Device not supported.