Detecting limited network connectivity in Android?

前端 未结 2 379
独厮守ぢ
独厮守ぢ 2020-12-16 06:45

There are a number of questions regarding how to detect network connectivity in Android. https://stackoverflow.com/a/4239019/90236 provides a very detailed answer and https:

2条回答
  •  清酒与你
    2020-12-16 07:00

    Is there a good way to determine that the user has a fully functioning network connection?

    Try downloading something from somewhere. Ideally, the "somewhere" is your own server, to test connectivity between the device and your server.

    Alas, there are no doesTehConnexionSuck() or iCanHazBandwidth() methods on ConnectivityManager. :-)

    Is this overkill?

    In the spirit of "Goldilocks and the Three Bears", I'd describe that as justrightkill.

    We have to do the same sorts of shenanigans in Web apps too.

提交回复
热议问题