pwittchen / ReactiveNetwork

Android library listening network connection state and Internet connectivity with RxJava Observables
http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/
Apache License 2.0
2.53k stars 276 forks source link

Get active connection speed #391

Open zigic88 opened 4 years ago

zigic88 commented 4 years ago

Hi Sir, with ReactiveNetwork can we get internet connection speed from ReactiveNetwork.observeInternetConnectivity() ?

pwittchen commented 4 years ago

Hi,

You don't need this library for this. You can check e.g. this solution: https://stackoverflow.com/questions/19154992/getting-data-speed-of-wifi-mobile-network-programmatically#19155177

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

śr., 13 lis 2019, 05:42 użytkownik Reja notifications@github.com napisał:

Hi Sir, with ReactiveNetwork can we get internet connection speed from ReactiveNetwork.observeInternetConnectivity() ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pwittchen/ReactiveNetwork/issues/391?email_source=notifications&email_token=AAFJYF63O32WR46RN5AIEZ3QTOASLA5CNFSM4JMQ2D72YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HY4NHAA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJYF24UWDJKCPGL5WHS3LQTOASLANCNFSM4JMQ2D7Q .

zigic88 commented 4 years ago

Thank you Sir for your reply,

But I have a case like this: application will observing internet connectivity continuously If (connection not available) then application will notifiy to user about no connection. else if ( ( connection available but connection speed is slow) ) then application will notifiy to user about slow connection

What do you think about that case? Can we use this reactivenetwork library to handle this case?

pwittchen commented 4 years ago

Then you'll need to perform combination of the library and the code snippet with connection speed wrapped as RxJava observable. These two observables will need to be combined with flatmap or switchmap operator. It requires additional coding. I cannot give you exact solution now because I am writing from the phone. Maybe I'll add possibility to read connection speed via this library on the future.

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

śr., 13 lis 2019, 05:56 użytkownik Reja notifications@github.com napisał:

Thank you Sir for your reply,

But I have a case like this: application will observing internet connectivity continuously If (connection not available) then application will notifiy to user about no connection. else if ( or ( connection available but connection speed is slow) ) then application will notifiy to user about slow connection

What do you think about that case? Can we use this reactivenetwork library to handle this case?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pwittchen/ReactiveNetwork/issues/391?email_source=notifications&email_token=AAFJYF3BW5RIKQQLXM4RSH3QTOCIRA5CNFSM4JMQ2D72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED44FWI#issuecomment-553239257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJYFYOJ2GFFL3MIMDJAT3QTOCIRANCNFSM4JMQ2D7Q .

zigic88 commented 4 years ago

Hi Sir, Thank you for your explanation. Can you give me some example later about two observables combined with flatmap or switchmap? Really thank you for you help.

pwittchen commented 4 years ago

I can try to provide such example later when I find some time, but I cannot promise you the exact date.

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

śr., 13 lis 2019, 16:22 użytkownik Reja notifications@github.com napisał:

Hi Sir, Thank you for your explanation. Can you give me some example later about two observables combined with flatmap or switchmap? Really thank you for you help.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pwittchen/ReactiveNetwork/issues/391?email_source=notifications&email_token=AAFJYFZVKJDQGBSYWAXXCN3QTQLUJA5CNFSM4JMQ2D72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED6PZ5A#issuecomment-553450740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJYF2N2LQBVIQORTE6BK3QTQLUJANCNFSM4JMQ2D7Q .

zigic88 commented 4 years ago

Okay Sir, I'll wait for it. Thank you for your help.