Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Places API always denies request
    primarykey
    data
    text
    <pre><code>j.setUrl("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&amp;radius=500&amp;types=food&amp;name=harbour&amp;sensor=false&amp;key=AIzaSyA712jyN6NY0VXSGf8zgXfXSRhq01O8RLY"); </code></pre> <p>This is my json url with my key. It always gives me status request denied . I have tried making alot of keys with debug keystore and new keystores but nothing works . it is the example url of google. It doesn't work for me. If you want to provide a solution regarding a new key please give me the detailed procedure on how to get a valid debug key. Please be very detailed. If you want to provide a solution regarding sensor paramater its there already. If you want json parser file its as below</p> <pre><code> package com.json; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONException; import org.json.JSONObject; import android.os.AsyncTask; public class JSONParser extends AsyncTask&lt;Void, Void, JSONObject&gt; { static InputStream is = null; static JSONObject jObj = null; static String json = ""; private String url; // constructor public JSONParser() { } @Override protected JSONObject doInBackground(Void... params) { // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(getUrl()); HttpResponse httpResponse = null; try { httpResponse = httpClient.execute(httpPost); } catch (ClientProtocolException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } HttpEntity httpEntity = httpResponse.getEntity(); try { is = httpEntity.getContent(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } BufferedReader reader = null; try { reader = new BufferedReader( new InputStreamReader(is, "iso-8859-1"), 8); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { is.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } json = sb.toString(); try { jObj = new JSONObject(json); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } // return JSON String return jObj; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } </code></pre> <p>}</p> <hr> <p><strong>EDIT</strong> : I looked at the reports of my api console it shows that requests were made, since i see requests I presume that the key is NOT invalid as it correctly leads to my api console. Please correct me if I'm wrong?</p> <hr> <p><strong>EDIT 2</strong> : So I tried everything now made a new Id, got a new api key for my debug keystore, made a whole new project using the url and json parser class. I still get request denied. Can someone help me?</p>
    singulars
    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.
 

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