ReactiveNetwork icon indicating copy to clipboard operation
ReactiveNetwork copied to clipboard

Deprecated NetworkInfo methods are used.

Open Lingviston opened this issue 6 years ago • 13 comments

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?

Lingviston avatar Jan 10 '19 08:01 Lingviston

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

pwittchen avatar Jan 10 '19 09:01 pwittchen

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.

abir-hasan avatar Jan 23 '19 07:01 abir-hasan

Hello, any update on this?

filipwiech avatar Apr 09 '19 11:04 filipwiech

Hi,

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

Regards.

pwittchen avatar Apr 09 '19 11:04 pwittchen

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.

pwittchen avatar Aug 08 '19 22:08 pwittchen

Hi, any news on this one?

arkivika avatar Sep 10 '19 16:09 arkivika

This upgrade is not trivial and I need to find free time to do this as it's my side project. Sorry for the inconvenience. If you'd like to receive updates faster, I'm open for Pull Requests.

-- Piotr Wittchen, http://wittchen.io

wt., 10 wrz 2019, 18:20 użytkownik arkivika [email protected] napisał:

Hi, any news on this one?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pwittchen/ReactiveNetwork/issues/318?email_source=notifications&email_token=AAFJYF5ZQRI7ABIX5DIM6ADQI7CNNA5CNFSM4GPD7HW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6LVZ5Q#issuecomment-530013430, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFJYF2OH5IPQYRNBIUAQU3QI7CNNANCNFSM4GPD7HWQ .

pwittchen avatar Sep 10 '19 16:09 pwittchen

Hi, any news on this one?

gcandrade10 avatar Oct 27 '19 02:10 gcandrade10

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

pwittchen avatar Oct 27 '19 08:10 pwittchen

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

Polyterative avatar Feb 14 '20 09:02 Polyterative

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

bhuangy avatar Apr 17 '20 23:04 bhuangy

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.

pwittchen avatar Apr 17 '20 23:04 pwittchen

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

adamsousa avatar Aug 23 '23 14:08 adamsousa