I made an Application that gives me the location of my Android phone.
Now I want to make开发者_运维问答 a method that helps me to retrieve the GPS location of my phone (latitude longitude or the address if possible) with an SMS.
Exemple: phone number 558899. I send an Sms with "get location" to 558899 an get a message back with the coordinates.
this may help:
"Capture" incoming SMS:
http://www.codemobiles.com/forum/viewtopic.php?p=95
Send SMS: http://www.anddev.org/how_to_send_sms-t552.html
Edit: Dead link. I don't remember what exactly was in it, just like Google's cache and Internet Wayback Machine. Following link should have some info on topic:
http://lamiaamb.wordpress.com/2012/03/19/android-capture-an-incoming-sms/
Use the Geocoder class. Pass it's getFromLocation()
method the longitude and latitude and the maximal number of results you want to get returned. You'll get a List
of Address objects.
精彩评论