Android-DFU-Library icon indicating copy to clipboard operation
Android-DFU-Library copied to clipboard

LocalBroadcastManager is deprecated

Open GregoryNowik opened this issue 3 years ago • 1 comments

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.

GregoryNowik avatar Sep 08 '22 13:09 GregoryNowik

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!

philips77 avatar Sep 08 '22 14:09 philips77