http://www.google.com/loc/json 回来结果不可用
http://www.google.com/loc/json 返回结果不可用
代码如下
代码如下
private Location callGear(ArrayList<WifiInfo> wifi, ArrayList<CellIDInfo> cellID) {
if (cellID == null) return null;
DefaultHttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://www.google.com/loc/json");
JSONObject holder = new JSONObject();
try {
holder.put("version", "1.1.0");
holder.put("host", "maps.google.com");
holder.put("home_mobile_country_code", cellID.get(0).mobileCountryCode);
holder.put("home_mobile_network_code", cellID.get(0).mobileNetworkCode);
holder.put("radio_type", cellID.get(0).radioType);
holder.put("request_address", true);
if ("460".equals(cellID.get(0).mobileCountryCode))
holder.put("address_language", "zh_CN");
else
holder.put("address_language", "en_US");
JSONObject data,current_data;
JSONArray array = new JSONArray();
current_data = new JSONObject();
current_data.put("cell_id", cellID.get(0).cellId);
current_data.put("mobile_country_code", cellID.get(0).mobileCountryCode);
current_data.put("mobile_network_code", cellID.get(0).mobileNetworkCode);
current_data.put("age", 0);
array.put(current_data);
if (cellID.size() > 2) {
for (int i = 1; i < cellID.size(); i++) {
data = new JSONObject();
data.put("cell_id", cellID.get(i).cellId);
data.put("location_area_code", cellID.get(0).locationAreaCode);