I’m not terribly familiar with Android devices so I can’t comment - actively maintaining a WiFi connection is fairly expensive, power-wise, and if you’re a mobile device and don’t expect to receive anything off of WiFi you’ll try to keep that radio off as much as possible - after all, any incoming push data can just go in via cellular which you have to leave on to receive calls/texts anyways, right?
Interesting data at: http://apple.stackexchange.com/questions/28100/is-wifi-enabled-in-ios-5-even-when-the-device-is-put-to-sleep
My iPhone 5 (and previous iPhones) does not autojoin my home wireless passively and it will disassociate when asleep - I’ll test this in greater detail with SNMP to get more precise timings. The phone will not disassociate if plugged in to power - this is so that iTunes wireless sync can work.
The only way to trigger association is to request data. Generally speaking, an application cannot request data if it isn’t running in the foreground - a closed app has 10 minutes to finish up whatever it’s doing, maximum - but there’s a trick:
Apps that are responding to a geofence notification (such as SmartThings) are treated as if they had just been launched and closed. The app then has (as far as I can tell) 10 minutes to do whatever it wants - such as ping the SmartThings cloud which will trigger a wifi connection - the app can query the OS to find out what SSID it’s connected to (Captive Network and Reachability classes, specifically) and report that to SmartThings - although, really, the best thing would be for SmartThings to monitor the local router with SNMP and fire alerts when devices connect or disconnect - this would be great for tracking guests, unauthorized use, etc.
You’d get one ping when you’re generally in range - GPS-based geofencing - and another ping when you’re actually on the WiFi - generally closer to the router / closer to being inside. For example, since my wireless network doesn’t reach the ground floor, I could have the heater start when I’m in geofencing range but the lights don’t turn on until I’m in WiFi range.