I am trying to use the Android-DFU-Library. I have successfully implemented it in my project (the implementation key in gradle). However, even utilizing the documentation and example programs, I cannot get it to work. (I have made the iOS version work)
I created my DfuProgressListener, I have created a DfuServiceInitiator, I have set the path fo the ZIP file (via setZip), and when I call "start"... nothing. Note, I am not doing this inside of an activity. This code is part of an Android library (AAR) that we use for isolating our bluetooth subsystem from companies we license our devices to. We handle all the low level BLE operations in here, such as setting up and enabling all our custom characteristics, as well as taking data we receive from our device and putting it into packages to return. The "context" that is passed in is the application context of the app that instantiates this library.
My code:
public void updateGen2Firmware(Context context, String path) {
Log.v (TAG, "Starting");
final DfuServiceInitiator starter = new DfuServiceInitiator(macAddress).setDeviceName(deviceName).setKeepBond(false);
starter.setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(true);
Log.v (TAG, "Setting zip to: " + path);
starter.setZip(path);
Log.v (TAG, "setting up progress listener");
DfuServiceListenerHelper.registerProgressListener(context, mDfuProgressListener);
Log.v (TAG, "calling the 'start' of starter");
starter.start(context, DfuBaseService.class);
}