Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Cell Tower Location API: Changed?
    primarykey
    data
    text
    <p>For the last few months I've been finding the locations of cell towers as we use their cellid and areaid, based on the following code:</p> <pre><code> public class GoogleService { public GoogleCell GetCellInfo(string lac, string mnc, string mcc, string cellID) { try { HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("https://www.google.com/loc/json"); myReq.Method = "POST"; myReq.ContentType = "application/jsonrequest"; string postData = "{\"cell_towers\": [{\"location_area_code\": \"" + lac + "\", \"mobile_network_code\": \"" + mnc + "\", \"cell_id\": \"" + cellID + "\", \"mobile_country_code\": \"" + mcc + "\"}], \"version\": \"1.1.0\", \"request_address\": \"true\"}"; myReq.ContentLength = postData.Length; StreamWriter stOut = new StreamWriter(myReq.GetRequestStream(), System.Text.Encoding.ASCII); stOut.Write(postData); stOut.Close(); HttpWebResponse webresponse; webresponse = (HttpWebResponse)myReq.GetResponse(); Encoding enc = System.Text.Encoding.UTF8; StreamReader loResponseStream = new StreamReader(webresponse.GetResponseStream(), enc); string Response = loResponseStream.ReadToEnd(); loResponseStream.Close(); webresponse.Close(); GoogleCell Mycell = JsonConvert.DeserializeObject&lt;GoogleCell&gt;(Response); return Mycell; } catch (Exception ex) { string strErr = ex.Message; if (ex.InnerException != null) { strErr += ": " + ex.InnerException.Message; } MessageBox.Show(strErr); return new GoogleCell(); } } } public class GoogleCell { public GoogleCell() { } public GoogleCell(string mnc, string mcc, string lac) { this.Mnc = mnc; this.Mcc = mcc; this.Lac = lac; } public string Mnc { get; set; } public string Mcc { get; set; } public string Lac { get; set; } public string CellID { get; set; } public Location location { get; set; } public class Location { public Location() { } public Location(string latitude, string longitude) { this.latitude = latitude; this.longitude = longitude; } public string latitude { get; set; } public string longitude { get; set; } public Address address { get; set; } public class Address { public Address() { } public string country { get; set; } public string country_code { get; set; } public string city { get; set; } public string region { get; set; } public string street { get; set; } public string street_number { get; set; } public string postal_code { get; set; } } } </code></pre> <p>The code worked flawlessly until sometime between one and two weeks ago, when it started returning error 400: Bad Request when it does the GetRequestStream().</p> <p>My code hasn't changed. I can't find any record of the API's parameters changing. What else could be going on? This uses Google Gears, which has been deprecated for a while now, but I can't find any doco on a replacement <strong>that finds cell towers.</strong></p> <p>any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload