Autocomplete Places User Control

Unofficial Content

This user control makes address fields filling easier by suggesting options to the user as they type.

Installation steps

  • Download the .zip file from the marketplace
  • Extract it on your GeneXus installation directory. If asked to overwrite anything, click Yes
  • Open a command line window at GeneXus directory and run "genexus /install" (without quotes)
  • Done!

Using the UC

  • Set an Android API Key on your Smart Devices generator properties, under "Android specific".

APIKeyImg_jpg

IMPORTANT: Places API for Android MUST BE enabled on your Project at Google Developer Console. In order to do this, you can take a look at this article, which guide you step by step on how to do it. This one explains how to get an API Key from Google in particular.

  • Drag and drop "Autocomplete Places" from the toolbox into a SDPanel layout
  • Create two Character(50) variables to set to the control in order to retrieve address and address coordinates
  • Create a Geolocation data type variable in order for GeneXus to take every Maps-related thing into the application
  • Set "Address variable" and "Lat Lng variable" UC's properties with the previously created variables
  • Pick a "Widget Type" from the property. You can choose between "Full screen" or "Overlay"
  • Select country of your choice to filter query results or just leave the property on "Auto Select" value so the application is able to pick device's country
  • Run your application! The user selected address and coordinates will be set on the variables you created.

Usage example

  • Drag and drop the control into a SDPanel
  • Set UC's properties

PropertiesImg2_jpg

 

VariablesImg2_jpg

 

Do not forget to properly declare required variables! Avoiding this step will prevent you from retrieving the value selected by the user.

  • Create an event that retrieves the selected address and do something with it
  • Do not forget to set an Android API Key on your Smart Devices generator properties, under "Android specific"
  • Run the application and give it a try!