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

Library does not work with Ethernet and other connection types #71

Closed
orbitbot opened this issue Jul 11, 2016 · 4 comments
Closed

Library does not work with Ethernet and other connection types #71

orbitbot opened this issue Jul 11, 2016 · 4 comments
Assignees

Comments

@orbitbot
Copy link

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 by NetworkInfo.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.

@pwittchen
Copy link
Owner

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,
Piotr

@pwittchen
Copy link
Owner

pwittchen commented Jul 17, 2016

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.

pwittchen pushed a commit that referenced this issue Jul 17, 2016
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
pwittchen pushed a commit that referenced this issue Jul 19, 2016
adding support for all network types - issue #71
@pwittchen
Copy link
Owner

pwittchen commented Jul 19, 2016

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.

@pwittchen pwittchen mentioned this issue Jul 24, 2016
13 tasks
@pwittchen
Copy link
Owner

pwittchen commented Jul 24, 2016

Branch 'develop' was merged into 'master' branch. An Update will be available in the release of v. 0.5.0.

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

2 participants