I have turned on Location based Wi-Fi Setting, I have followed the steps to enable this feature for a Wi-Fi Network at Home and at College, so, whenever I am at either of these two Locations Wi-Fi automatically turns on, But I wish to know how this happen, because the Wi-Fi automatically turns on when near the saved Wi-Fi, it happens even when Mobile Data is switched off. I want to further add that I had kept the GPS off during the entire process mentioned above. I don't understand how can it know that the device is near a Saved Wi-Fi region.
Location based Wifi apps such as Wi-Fi Matic will remember the cell tower ids of your mobile network operator and link it with the connected wifi network. The cell tower id is area dependent, and wifi network in most cases is area dependent. So, it works.
These apps or services constantly monitor the cell tower id of your phone's connected network. And if they find the matched cell tower ids, they know that phone is in/around known wifi network and turn the wifi on.
Similarly, when the cell tower id doesn't match the ones linked with remembered wifi's, it just turns off wifi.
And monitoring tower ids doesn't require data connection. There is no reverse lookup of location here. Just known cell tower ids linked to known wifi networks.
In recent versions of android, there is an option in Wifi advanced settings, called
Scanning always available. If you turn on this setting, background scanning always happens even when wifi is off, knowing the access point names of detected wifi networks. Such apps can also use this data to turn on/off wifi based on saved networks.