Android Question Google Places

Discussion in 'Android Questions' started by Mike1970, May 14, 2019.

  1. Mike1970

    Mike1970 Active Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Mike1970

    Mike1970 Active Member Licensed User

  4. Jorge M A

    Jorge M A Active Member Licensed User

    Code:
    Wait For(PlaceToLatLon("Israel Yodfat")) Complete (ll() As Double)
    "Israel Yodfat" is the query parameter.
     
    Mike1970 likes this.
  5. Mike1970

    Mike1970 Active Member Licensed User

    So.. i have to implement that Sub, with the query parameter ,and it gives me back the Longitude and Latitude right? (I understand like this).

    The thing i wish to do is something like:

    - Query Parameter: Starbucks (ex)
    - Result: A list of Near places named "Starbucks" like Google Maps.

    So.. i can get the image, the name, ecc ecc

    Because i saw on the info page of GooglePlaces that i can use filters, and many other things, but i didn't understand how to use it, and i wished that somebondy already used it , and can give me some tips.
     
  6. Jorge M A

    Jorge M A Active Member Licensed User

  7. Mike1970

    Mike1970 Active Member Licensed User

  8. Mike1970

    Mike1970 Active Member Licensed User

    I’m looking for it on the forum , but meanwhile ....

    2E9E0446-D7AC-4A09-ABE5-EA50BA1FE90F.jpeg
    This is what I would achieve (using Googles PLACES API )
     
  9. Jorge M A

    Jorge M A Active Member Licensed User

  10. DonManfred

    DonManfred Expert Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    Mike1970 and Jorge M A like this.
  12. Mike1970

    Mike1970 Active Member Licensed User

    Yeah, i already downloaded that file.. but when i run that code and i wrote something in the searchbar nothing happend (i created the Google Places API key and i put it in the code)

    Edit:
    I took a look at the class code, and i think i spotted where i can modify to add parameters and how (reading what google say abouth html request). But the problem still the same, the file i downloaded doesn't gives errors, but doesn't give result as in the image too.. what could be the problem?

    eee.jpg
     
    Last edited: May 16, 2019
  13. Jorge M A

    Jorge M A Active Member Licensed User

    Surely your problem is with your Google Account Apis and/or Credentials an how you configured it.

    Try put this in your browser, replacing your key:

    Code:
    https://maps.googleapis.com/maps/api/place/autocomplete/json?input=London&key=[YOUR_HIDDEN_KEY_HERE]
    Is possible that you see a message similar to this:

    Code:
    {
       
    "error_message" : "You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account: http://g.co/dev/maps-no-account",
       
    "predictions" : [],
       
    "status" : "OVER_QUERY_LIMIT"
    }
     
    Erel and Mike1970 like this.
  14. Mike1970

    Mike1970 Active Member Licensed User


    Yes i get this D:
    There is a usage limit, after that it will won't work?
    What i could do?
     
  15. Jorge M A

    Jorge M A Active Member Licensed User

    Please read the recommendations carefully and in detail for future occasions.
    There you will find the answers related to Google services.

    Untitled.png
     
    Erel likes this.
  16. Mike1970

    Mike1970 Active Member Licensed User


    After reserching problems, i found this (the links for quotas in the documentations doesn't work properly, so i had to find another way to see this information)
    Annotazione 2019-05-17 095411.jpg
    1 Request per day...

    I can't add nothing.. it say that i have to enable billing for this project
     
  17. Jorge M A

    Jorge M A Active Member Licensed User

    By the mail I received previously from the post that is no longer here:

    It was never my intention to be aggressive. Just stating that it is very important to spend time studying, especially the experts' recommendations, and all related forum topics. That's how I've learned from scratch every element to use in Android.

    On the other hand, also know how to distinguish when it comes to an issue of B4A or third parties, in this case Google.
    Google has greatly changed its policies and modes of operation in recent times, and so the example codes generously made available to us by forum members may not currently work as they are.
    There's the opportunity area to update.

    This refers to the fact that there are multiple users using the application, who can concurrently use the same API.

    Yeah, that's how this works NOW with Google. :(


    Good job! ;)
     
    Mike1970 likes this.
  18. Mike1970

    Mike1970 Active Member Licensed User


    Ok thanks. I saw that there is a free plan, maybe i can try to get funcitoning that and then try again.., because if the api didn't work i can't test my app

    (I'm the only user to use that app...)
     
  19. DonManfred

    DonManfred Expert Licensed User

    I suggest to add a billing to your account.
    With billingaccount you can create a new Apikey and restrict it to your app.
    You´ll get the Free Requests for your Apikey. If you stay in they limit then nothing is billed.
     
    Mike1970 and Jorge M A like this.
  20. Mike1970

    Mike1970 Active Member Licensed User

    OK, i done it.
    I add a biling to my account so i UNlocked the limitation of the API.
    Then, to Find the the businesses as i want, i modified the Job in the Erel's examples in to this

    Code:
    j.Download2("https://maps.googleapis.com/maps/api/place/autocomplete/json", _
                
    Array As String("input", New, "type""establishment""location""45.156389,10.791440","radius",500"key", Main.GoogleApiKey))
    and it works very well now.
    Thanks you all
     
    DonManfred and Jorge M A like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice