title: Cannot connect to google directions API
body: <p>I am trying to use Google Directions API using an Android Application.</p>
  
  <p>On the google developer console, I created a project and selected the Android platform.</p>
  
  <p>Using my unique package name and SHA1 key, I got an API key.</p>
  
  <p>In my android code, I am using this API key to send an HTTP request.</p>
  
  <pre><code>url = "https://maps.googleapis.com/maps/api/directions/json?origin=Dhanmondi&amp;destination="+destination+"&amp;key=" + apiKey;
  
  
  
  public String sendGetRequest(String uri) {
      try {
          URL url = new URL(uri);
          HttpURLConnection con = (HttpURLConnection) url.openConnection();
          BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));
  
          String result;
  
          StringBuilder sb = new StringBuilder();
  
          while((result = bufferedReader.readLine())!=null){
              sb.append(result);
          }
  
          return sb.toString();
      } catch (Exception e) {
          return null;
      }
  }
  </code></pre>
  
  <p>However, I am getting this error.</p>
  
  <p><strong>This IP, site or mobile application is not authorized to use this API key. Request received from IP address 112.13.34.221 with empty referrer.</strong></p>
  
  <p>I have enabled Google Maps for Android API as well as Google Directions, Google Roads and Google Places API</p>
  
  <p><a href="https://i.stack.imgur.com/KrjXN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KrjXN.png" alt="enter image description here"></a></p>