NordicSemiconductor / Android-DFU-Library

Device Firmware Update library and Android app
http://www.nordicsemi.com/dfu
BSD 3-Clause "New" or "Revised" License
753 stars 263 forks source link

LocalBroadcastManager is deprecated #354

Open GregoryNowik opened 1 year ago

GregoryNowik commented 1 year ago

Library version: 2.0.3

This class is deprecated. LocalBroadcastManager is an application-wide event bus and embraces layer violations in your app: any component may listen events from any other. You can replace usage of LocalBroadcastManager with other implementation of observable pattern, depending on your usecase suitable options may be androidx.lifecycle.LiveData or reactive streams.

https://developer.android.com/reference/androidx/localbroadcastmanager/content/LocalBroadcastManager

as per your documentation :

The service will send local broadcast events using LocalBroadcastManager.

This is preventing me from having a warning-free project. Is there any plan on the roadmap to implement a different system to communicate between the DFU service and the app ?
I was thinking static flows would be easier to implement and less risky.

philips77 commented 1 year ago

There's a lot of deprecated code in this project, including the fact that it runs in an IntentService. The lib would have to be rewritten to remove all the warnings. The library was written very long time ago, but still works, despite all the warnings. New one would have less warnings, but more bugs, I suppose :) We may think of migrating it to Kotlin at some point, but don't have time in the near future, sorry!