How to Auto-Toggle Your Android Device's Wi-Fi On and Off When Near or Away from a Hotspot
Whether it's using precious data or wasting battery power, switching between Wi-Fi and cellular service on your Android device can be a hassle. If your Wi-Fi is off, you may not know about free hotspot networks in the area you're in, leading you to waste network data (which more than likely is not unlimited). If your Wi-Fi is on all of the time, this leads to quicker battery depletion.
There are already a few Android apps, like Auto WiFi Toggler, that combat this problem, but they just periodically turn the Wi-Fi on.
Personally, I don't find that efficient enough. Either did XDA Developers member sebouh00, who created a new free app called Smart WiFi Toggler, which conserves battery and minimizes data charges by automatically turning your Wi-Fi on and off when needed.
Smart WiFi Toggler uses your network location (no GPS battery drain) to learn your Wi-Fi hotspot locations. Whenever you're in range of the hotspot, your phone will automatically connect. When you leave, the application turns off your Wi-Fi, until you're in range of another hotspot.
The app provides the ability to control "auto-connect" behavior for each hotspot, so that the phone won't connect to every single hotspot it encounters. You will also receive warning notification and auto-locking Wi-Fi whenever a hotspot is down.