0

I have exactly the same problem as Autocomplete textview google places api

But the fixes suggested to him don't fix the problem with my case. I uses the exact same code. But it does not work.

tanks for the api tip

i debuged the problem and saw i am getting a respond of zero_results

Any suggestion?

                String input = "";

        try {
            input = "input=" + URLEncoder.encode(place[0], "utf-8");
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }

        // place type to be searched
        String types = "types=geocode";

        // Sensor enabled
        String sensor = "sensor=false";

        // Building the parameters to the web service
        String parameters = input + "&" + types + "&" + sensor + "&" + key;

        // Output format
        String output = "json";

        // Building the url to the web service
        String url =         "https://maps.googleapis.com/maps/api/place/autocomplete/json?input="
                + output + "?" + parameters;
Community
  • 1
  • 1
mosheovadi1
  • 73
  • 12
  • you are getting you own API key from https://code.google.com/apis/console?? – hcarrasko Apr 07 '14 at 09:06
  • yes i have got an api key- i have kept on tring to debug it.. apperently i get from the server this answer: **{ "error_message" : "This IP, site or mobile application is not authorized to use this API key.", "predictions" : [], "status" : "REQUEST_DENIED"}** i have gave google my SHA1 certificate and the packet name of the activity who call him any segestion whay it will heppend? – mosheovadi1 Apr 07 '14 at 11:35
  • ok fixt the api key... replaced it with server api key not i get a response of: ZERO_RESULTS – mosheovadi1 Apr 07 '14 at 12:08

1 Answers1

2

You problem is you API key configuration. Make sure you are creating an API key in "Public API access" section.

Public API access

  • You can find how to get the finger print in this post:

How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android?

  • Then in google console register you API key. Remember add to the final you name package declared in your Android Manifest.

  • finger print example:

F7:DB:FF:EB:6E:AD:C1:D6:84:05:1D:BA:F7:94:0D:E4:1F:2E:3C:8C;cl.hcarrasco.tm

  • Enable Google Places API: Remember too do this:

enter image description here

I hope this can help you.

Community
  • 1
  • 1
hcarrasko
  • 2,320
  • 6
  • 33
  • 45