Skip to content

Deprecated NetworkInfo methods are used. #318

Open

Description

@Lingviston

Since API 28 all NetworkInfo properties are deprecated https://developer.android.com/reference/android/net/NetworkInfo and it is intended not to use them but use NetworkCallback instead.

ReactiveNetwork already uses NetworkCallback on Marshmellow and higher https://github.com/pwittchen/ReactiveNetwork/blob/RxJava2.x/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/network/observing/strategy/MarshmallowNetworkObservingStrategy.java but still uses NetworkInfo to construct the final Connectivity object (https://github.com/pwittchen/ReactiveNetwork/blob/RxJava2.x/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/Connectivity.java)

Since methods are deprecated in API 28 it is not safe to use them in production apps. Of course it is possible to implement custom NetworkObservingStrategy but are there any plans to implement full support of new API out of the box?

Activity

  1. pwittchen commented on Jan 10, 2019

    @pwittchen
    Owner

    Hi,

    Thanks for reporting this. I didn't know about deprecated properties of NetworkInfo class. I'll try to update the library and get rid of deprecated code as soon as I can.

    Regards,
    Piotr

  2. abir-hasan commented on Jan 23, 2019

    @abir-hasan

    I'm having similar problem after updating my test device to Android Pie (API-level-28). Cause when the device was in Oreo i was getting all the necessary data(specially the SSID from extraInfo field, after getting connected to a WIFI source) from the observeNetworkConnectivity methods response. Now its returning extraInfo and reason null.

  3. filipwiech commented on Apr 9, 2019

    @filipwiech

    Hello, any update on this?

  4. pwittchen commented on Apr 9, 2019

    @pwittchen
    Owner

    Hi,

    I didn't have time to work on this. I'll try to fix it as soon as I can.

    Regards.

  5. pinned this issue on Aug 8, 2019
  6. pwittchen commented on Aug 8, 2019

    @pwittchen
    Owner

    I had a look at this. I see that adjusting this library to the new API without breaking backward-compatibility and tests is not trivial. I think, this issue has the highest priority in this project now, so I'll focus on it first.

  7. arkivika commented on Sep 10, 2019

    @arkivika

    Hi, any news on this one?

  8. pwittchen commented on Sep 10, 2019

    @pwittchen
    Owner
  9. gcandrade10 commented on Oct 27, 2019

    @gcandrade10

    Hi, any news on this one?

  10. pwittchen commented on Oct 27, 2019

    @pwittchen
    Owner

    Hi,

    Not yet. If you'd like to have this update faster, then I'm open for PRs as always. :-)
    In case of fixing this problem, I'll update this issue in the future.

    Regards,
    Piotr

  11. Polyterative commented on Feb 14, 2020

    @Polyterative

    Any alternative library/util to use until this is updated? My gradle is not allowing me to compile because of this deprecated use

  12. bhuangy commented on Apr 17, 2020

    @bhuangy

    Looks like this is still an issue. Any updates on this?

  13. pwittchen commented on Apr 17, 2020

    @pwittchen
    Owner

    Like I said, I'll try to do it in the meantime, but if you want to have the update faster, you can create a new PR. Project is open-source.

  14. adamsousa commented on Aug 23, 2023

    @adamsousa

    Any updates on this? Seeing some related issues also haven't been merged yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions