I use Tasker for Android. Not sure if anyone else uses this app but it lets you automate a ton of stuff depending on events, phone states, and a ton of other stuff. I have several profiles to do different things from going silent at night except for specific phone numbers in case of emergency to auto responding to texts at night stating I am asleep and to leave me alone. You can even turn these profiles or tasks into application and you can create GUIs for them, etc. Anyway, I created a couple of tasks so that my wife can send me a text asking "Where are you?" and my phone will grab my location first by Wifi if it is connected or alternatively GPS.
Here they are if anyone is interested in trying them out.
Get_LOC_Via_GPS.prf.xml
Get_LOC_Via_Wi_Fi.prf.xml