I’ve been using the following code snippet which I think I got off the forum sometime last year. Seems to imply that the network.setStatusListener does not work on Android and hence the alternate check. Do note the alternate check simply verifies that the device is connected to a network but does not actually verify internet connection direct to a host as network.setStatusListener would do. This is a shortcoming of course. Anyways, for what its worth…
I would love to see some better ways of going about this. Thanks!
if system.getInfo( "platformName" ) == "Android" then local status = network.getConnectionStatus() if status.isConnected then gotConnection = true -- trigger download function here end else if network.canDetectNetworkStatusChanges then network.setStatusListener( "www.google.com", MyNetworkReachabilityListener ) --MyNetworkReachabilityListener triggers download function print("Waiting for network response") else print("network reachability not supported on this platform") native.showAlert( "Network Error", "Network reachability not supported on this platform.", {"OK"} ) end end