networking - Detecting limited network connectivity in Android? -


there number of questions regarding how detect network connectivity in android. https://stackoverflow.com/a/4239019/90236 provides detailed answer , https://stackoverflow.com/a/8548926/90236 shows methods identify type of network 1 connected.

we detect network connectivity using code similar answers like:

private boolean isnetworkavailable() {     connectivitymanager connectivitymanager            = (connectivitymanager) getsystemservice(context.connectivity_service);     networkinfo activenetworkinfo = connectivitymanager.getactivenetworkinfo();     return activenetworkinfo != null && activenetworkinfo.isconnected(); } 

this lets warn user if offline. however, doesn't identify if user has limited connectivity. there conditions of limited connectivity have caused users complain. these include:

  1. users connected home wifi network cable modem or internet service unavailable.

  2. users in hotel or coffee shop , connect wifi network, network requires login or agree terms of service before given full network access.

in both of these situations our isnetworkavailable() test returns true. os tells connected network. however, user not have usable internet connectivity.

is there way determine user has functioning network connection?

i'm considering calling lightweight web service verify connectivity , warn user if app doesn't valid return service. overkill? or have others had resort similar techniques?

is there way determine user has functioning network connection?

try downloading somewhere. ideally, "somewhere" own server, test connectivity between device , server.

alas, there no doestehconnexionsuck() or icanhazbandwidth() methods on connectivitymanager. :-)

is overkill?

in spirit of "goldilocks , 3 bears", i'd describe justrightkill.

we have the same sorts of shenanigans in web apps too.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -