Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated NetworkInfo methods are used. #318

Open
Lingviston opened this issue Jan 10, 2019 · 13 comments
Open

Deprecated NetworkInfo methods are used. #318

Lingviston opened this issue Jan 10, 2019 · 13 comments

Comments

@Lingviston
Copy link

Lingviston commented Jan 10, 2019

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?

@pwittchen
Copy link
Owner

pwittchen commented Jan 10, 2019

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

@abir-hasan
Copy link

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.

@filipwiech
Copy link

Hello, any update on this?

@pwittchen
Copy link
Owner

Hi,

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

Regards.

@pwittchen pwittchen pinned this issue Aug 8, 2019
@pwittchen
Copy link
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.

@arkivika
Copy link

Hi, any news on this one?

@pwittchen
Copy link
Owner

pwittchen commented Sep 10, 2019 via email

@gcandrade10
Copy link

Hi, any news on this one?

@pwittchen
Copy link
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

@Polyterative
Copy link

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

@bhuangy
Copy link

bhuangy commented Apr 17, 2020

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

@pwittchen
Copy link
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.

@adamsousa
Copy link

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
Projects
None yet
Development

No branches or pull requests

9 participants