, GPS , stackoverflow.com : Android?
google api, : using-google-maps-android
Update:
public class JsonDownloader{
private static final String URI = "http://mySite.net/rest/getData.php";
@SuppressWarnings("unchecked")
public static String receiveData(){
String result = "";
DefaultHttpClient client = new DefaultHttpClient();
HttpGet method = new HttpGet(url);
HttpResponse res = null;
try {
res = client.execute(method);
} catch (ClientProtocolException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
try{
InputStream is = res.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
result = sb.toString();
}catch(Exception e){
Log.e("log_tag", "Error converting result "+e.toString());
}
return result;
}
}
HTTP- , php script. gps- - .
gps , , . . postData: http://www.androidsnippets.org/snippets/36/index.html
, , . : http://android-projects.de/2010/08/13/threading-in-android-apps/