konghou
String url = "http://api.map.baidu.com/geocoder/v2/?ak=2uZgkxkTV4BCdGfAWN6m3cra&callback=renderReverse&location=39.983424,116.322987&output=json&pois=0";
URL getUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
connection.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(),"utf-8"));//设置
String result = reader.readLine();
JSONObject json = JSONObject.fromObject(result);
String address= json.getString("result");
json = JSONObject.fromObject(address);
address = json.getString("formatted_address");
System.out.println(address);

 

分类:

技术点:

相关文章:

  • 2021-11-18
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-12-19
  • 2022-01-30
  • 2022-01-03
猜你喜欢
  • 2021-07-23
  • 2021-09-02
  • 2021-11-08
  • 2022-12-23
  • 2021-12-04
  • 2021-12-06
  • 2021-09-21
相关资源
相似解决方案