How to retrieve the GPS location via SMS

南楼画角 提交于 2019-12-03 20:15:34

问题


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.


回答1:


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/




回答2:


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.



来源:https://stackoverflow.com/questions/4345535/how-to-retrieve-the-gps-location-via-sms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!