B4A Class [B4X] [custom view] Google Place Autocomplete View

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jul 23, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    B4A, B4i and B4J classes are attached.

    PlacesAutocompleteView is based on SearchView. It calls Google's Places autocomplete API to let the user select a place.

    Once selected it sends another request to get the exact location. You can get other information as well.

    [​IMG] [​IMG]

    B4A project depends on: B4A v7+, IME, JSON and OkHttpUtils2
    B4i project depends on: B4i v4+, iHttpUtils2, iJSON and iUI8.

    - In order to use Google Places API you need to create a project in Google developer console: https://console.developers.google.com/
    - Enable Google Places API Web Service api.
    - Create an API key and set it in Main.Process_Globals.

    Make sure to go over Google's policies: https://developers.google.com/places/web-service/policies#logo_requirements
    The usage limits for a free unidentified account are quite low. Once identified the limits are much higher.
     

    Attached Files:

    Last edited: Jul 24, 2017
    koaunglay, Magma, DonManfred and 8 others like this.
  2. MarcoRome

    MarcoRome Expert Licensed User

    Great work Erel
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Rantor777 and DonManfred like this.
  4. Magma

    Magma Well-Known Member Licensed User

    @Erel why b4j class not working. I using my api key... but when typing the list extends or being small without anything in... ?

    this class is exactly what i need for Addresses... seems that must have limits and bounds if works
     
  5. DonManfred

    DonManfred Expert Licensed User

    Create a new thread in the questionsforum and post a sample project which shoes the issue.
    Without seeing what you are doing and how we hardly can´t help.
     
  6. Magma

    Magma Well-Known Member Licensed User

    @DonManfred just open the example and replace the api key... for me not works for you ?
     
  7. DonManfred

    DonManfred Expert Licensed User

    i did not tried it... But i guess you forget to
    maybe you api-key is not bound to use the Google Places Api Web Service?

    I´ll check the example this evening. But i´m pretty sure it will work if i setup everything correctly.

    plces_005.jpg
     
    Magma likes this.
  8. Magma

    Magma Well-Known Member Licensed User

    @DonManfred As always you ve right i tried to use javascript google map api key not google places api key for web ! - it works excellent
     
    Last edited: Aug 2, 2017
  9. Mike1970

    Mike1970 Active Member Licensed User

    it's possible to change the "visible" parameter by code?
     
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