// Obtain the geographic position private string getlocation (situde ws itude) throws exception {string resultstring = "";/** the get method is used here, directly add the parameter to the URL */string urlstring = string. format ("http://maps.google.cn/maps/geo? Key = abcdefg & Q = % s, % s ", required. latitude, longitude. longpolling); log. I ("url", urlstring);/** create httpclient */httpclient client = new defaulthttpclient (); /** use the get Method */httpget get = new httpget (urlstring); try {/** to initiate a GET request and obtain the returned data */httpresponse response = client.exe cute (get ); httpentity entity = response. getentity (); bufferedreader buffreader = new bufferedreader (New inputstreamreader (entity. getcontent (); string Buffer strbuff = new stringbuffer (); string result = NULL; while (result = buffreader. Readline ())! = NULL) {strbuff. append (result);} resultstring = strbuff. tostring ();/** parse JSON data to obtain the physical address */If (resultstring! = NULL & resultstring. length ()> 0) {jsonobject = new jsonobject (resultstring); jsonarray = new jsonarray (jsonobject. get ("placemark "). tostring (); resultstring = ""; for (INT I = 0; I <jsonarray. length (); I ++) {resultstring = jsonarray. getjsonobject (I ). getstring ("Address") ;}} catch (exception e) {Throw new exception ("An error occurred while obtaining the physical location:" + E. getmessage ();} finally {Get. abort (); client = NULL;} return resultstring ;}