-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Library does not work with Ethernet and other connection types #71
Comments
Hi, Thanks for reporting that issue. I haven't taken into consideration ethernet connection because I focused only on mobile devices. Your idea with monitoring state is good. We can improve existing solution and refactor code to make it more flexible, so users can monitor network state and type separately if they want to. I will take a closer look on that and if it will be possible, I'll improve the code in way, which would be useful also in your use case. Regards, |
I've added support for all network types in PR #73. Now it should work with Ethernet connection and actually any connection type. Unfortunately, this update will break library API a little bit, but this change is a real improvement for this project. @orbitbot if you have some time, you can verify code and test it on a feature branch to check is everything is ok for you. If there will be any issue, I can fix it on a feature branch. I'm gonna merge it to the master branch soon. |
commit d3bfa0f30c7794e4803ecf5d439cae4a0010532e Author: Piotr Wittchen <piotr@wittchen.biz.pl> Date: Sun Jul 17 21:20:31 2016 +0200 adding support for all network types - issue #71
adding support for all network types - issue #71
It was merged to 'develop' branch. Now I need to perform other tasks on 'develop' branch. Before release, 'develop' will be merged to the 'master' branch. |
Branch 'develop' was merged into 'master' branch. An Update will be available in the release of v. 0.5.0. |
Thanks for a nice library, it looks very useful! We were about to take this into use, but discovered that because of the implementation our app cannot react to ethernet connections. This makes it unsuitable for use on f.e. Android TV which has a ethernet port and is likely to be connected using this, which is our use case.
One solution might be to add ethernet to the available ConnectivityStatus Enum. Another would be to ignore the network type and observe Android
NetworkInfo.State
, perhaps as an addition to the existing ConnectivityStatus. In our use cases so far we have only cared about being connected (as indicated byNetworkInfo.State.CONNECTED
) or not, ie. a binary state, which could be handled by filtering events as you've already indicated in your README example.As a third suggestion, it's probably possible to re-use or mirror the different network types in
ConnectivityManager
, eg.ConnectivityManager.TYPE_WIFI
,ConnectivityManager.TYPE_MOBILE
instead of creating a separate Enum with the same end result.The text was updated successfully, but these errors were encountered: