One of the main points of an app like woofi is to conserve battery life, so implementing features in a resource-conscious manner is paramount.
Of course, the biggest thing we do is make sure the WiFi radio is on for the smallest amount of time possible. Â This brings us to the first trade off we have to juggle. Â We can’t know for sure if we want the WiFi radio to be turned on without turning it on and checking for available access points. Â If we turn on and then connect to an access point, all is good. Â If we turn on and there is no access point to connect to we just wasted a bit of your battery life.
What we want to do is turn on the WiFi radio and then only stay on for the absolute shortest time possible. Â The problem is this: Â we don’t know what the shortest time possible is! Â Some Android devices and some access points take longer than others. Â If we only turn on WiFi for 5 seconds and then decide no access point is available, but your device and access point normally take 10 seconds to establish a connection we’ve failed the user.
Our solution to this is to pick a reasonable default time, and allow the user to increase it if they have a slow-to-connect access point.
Related articles
- An Android WiFi App I Need (avc.com)