NordicSemiconductor / Android-nRF-Toolbox

The nRF Toolbox is a container app that stores your Nordic Semiconductor apps for Bluetooth Low Energy in one location.
https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Toolbox
BSD 3-Clause "New" or "Revised" License
1.1k stars 464 forks source link

getGattCallback() in GlucoseManager errors "Method does not override method from its superclass" (Problems with GlucoseManager.class) #52

Closed Abushawish closed 6 years ago

Abushawish commented 6 years ago

Hello, first I wanted to thank you for this amazing library, however I would appreciate some help. I'm not sure if I'm misunderstanding, but I'm running into many problems within the GlucoseManager class.

1) Method doesn't override Within the GlucoseManager which extends BleManager:

public class GlucoseManager extends BleManager<GlucoseManagerCallbacks> {...{

There is a method which overrides getGattCallback():

@Override
protected BleManagerGattCallback getGattCallback() {
  return mGattCallback;
}

However, Android Studio shows an error:

 "Method does not override method from its superclass"

2) BleManagerGattCallback override problems But that's not the only method erroring like that, there's a also the BleManagerGattCallback also within the GlucoseManager:

private final BleManagerGattCallback mGattCallback = new BleManagerGattCallback() {
  @Override
  protected Deque<Request> initGatt(final BluetoothGatt gatt) {
    ...
  }
  @Override
  public boolean isRequiredServiceSupported(final BluetoothGatt gatt) {
    ...
  }
  ...
  @Override
  protected void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic) {
    ...
  }
  ...
}

Every function within the BleManagerGattCallback which has \@Override errors with "Method does not override method from its superclass".

3) BleManagerCallbacks cannot resolve methods Also with GlucoseManager, any method call using BleManagerCallbacks mCallbacks; states "Cannot resolve method 'methodNameHere(argumentHere)" such as:

mCallbacks.onDatasetChanged(gatt.getDevice());
...
mCallbacks.onNumberOfRecordsRequested(gatt.getDevice(), number);
...
mCallbacks.onOperationCompleted(gatt.getDevice());
...
mCallbacks.onOperationCompleted(mBluetoothDevice);
...

I'm not sure if I'm doing something wrong or misunderstanding, but there seems to be many issues with the GlucoseManager? I really appreciate you uploading this library, it has been a tremendous help and any further help would really be appreciated :).

philips77 commented 6 years ago

Hi, sorry for the delay. I'll release an update to the nRF Toolbox today. There current version on master branch will be adjusted to match recent changes in the BLE library. Also, I'm working on version 2 of the BLE library (check here. The nRF Toolbox is compatible with the new version also on develop branch. To compile the project, you also have to clone BLE Common Lib . I'll try to release all libs on jcenter today/beginning of next week. Sorry for inconvenience.

Abushawish commented 6 years ago

That's so awesome, thank you for the response :)!

philips77 commented 6 years ago

Hi, please pull latest changes. This should be fixed now. Also, I'll move the current branch do version1 branch, and merger develop into master. Develop (and soon master) branch is using BLE Library v2.0-alpha1.