Touchkit offline mode wifi detection

Hi there,

I’m developing a touchkit application based on the Vaadin parking demo. When the application is offline it stores pictures and data locally and when it is online again it automatically transfers the data to the server where it is stored in a database.

To limit mobile data transfer the data should only be transfered to the server when a Wifi connection is avaliable. Is there any way in touchkit or gwt to check if Wifi is available?

Thanks for your help
Rolf

Pretty sure you have to rely on the underlying OS to tell you that (for instance via the ConnectivityManager in Android: https://developer.android.com/reference/android/net/ConnectivityManager)

Now, what you could do is to try a short download speed check with a known file and deduce that you might be on WIFI. Another way could be to do a traceroute-like call and check whether the traffic goes over the IP ranges that the telcos use for their IP traffic but that is heuristic as well.