I can specify a square where the Geocoder shall search in, but I found no way to specify a certain country. Unfortunately, my country isn't quadrangular ;( What should I do? Use another reverse geocoding service?
I'd want to build a search box where the user can search for a city (with auto suggestion). On every keystroke the current search query is going to be delivered to the Geocoder.
If it's any help, the official Geocoding API can do regional biasing. It would require you to use their web API instead of the Android API.
Related
I'm working on an Android Studio project using Firebase as my database. How am I going to filter the places using google GPS to obtain the nearest places from the user? For example, when the user clicks on the option "within 2km", the system will sort out the places within 2km from the users' current place. Thanks if anyone can provide me a guideline on this.
https://developers.google.com/places/web-service/autocomplete
In optional parameters you can use radius or strictbounds if you are using Place Autocomplete.
I am trying to implement an android app where users can enter their city , and I need to add a marker to that city user input.
So far I was stumbling upon google auto-complete API , then I got autocomplete part working . But now I need to place a marker and for that and I need geo-code of the city that user entered , but as I understand google API for auto-complete only provide address or city , no geo-codinates.
Since I am fairly new to android development , can someone assist me with this situation and let me know whether there is a method of getting geo-codinates from single auto-complete API call ?
"you can convert an address to the corresponding geographic coordinates. This process is called geocoding"
Android come with some tools for geo data manipulation as the Geocoder class, I don't know if it is the most efficient solution, but you can try it.
When you obtain the address description with autocomplete api you can call a service to do the geocoding and get the geographic data, then you can show it in your map.
You should read this!
This is an example
I am trying to build a location based application which shows google map and allows the user to search a location by writing an address (as google maps does).
I have been trying to use android's geocoder to do this, and it finds some addresses. However, one of the first addresses that i tried (vaasankatu, helsinki, finland), it didn't find when I searched by street name (vaasankatu). Also one other street name that I have tried does not return any results. If I add the city (helsinki), or the country (finland) after the street name, then geocoder finds addresses.
Google maps web app and android app find the addresses without any problem just by searching by the street name. I am wondering whether I could somehow make geocoder to return the address when it is searched by the street name? I could of course try to find out the current city with the geocoder and attach it after the query, but this seems a bit like a hack, is there a better way?
I am also a bit worried about the geocoder documentation, which says:
"The Geocoder class requires a backend service that is not included in
the core android framework. The Geocoder query methods will return an
empty list if there no backend service in the platform. Use the
isPresent() method to determine whether a Geocoder implementation
exists."
I don't quite understand what that means.. So is there a big portion of phones that don't support geocoder? The text seems to suggest there might be, but why would there be such an api then at all..? Should I use another api alltogether? Is, for example Google geocoding api for web services usually used? Or places api?
I am building an app that makes use of phone numbers. I would like to have a user select a country and then based on that country prepend the country code to their phone number.
Is there a standard way for doing this in android? I thought the answer was Place AutoComplete, an android service for adding places, but that does not seem to be the answer; at least I can't get the country code from that service as explained on The Google Developer Academy site.
Does anyone know how I might get this done?
You can use this library by google for handling phone numbers on android. You will need to send the country code once the user selects and then use the PhoneNumberUtil.getInstance().parse(,)
I have a form in which user will type his address but i want to create such widget for address so that whenever user types his address, then all similiar location will be listed in the suggestion box and user can select his location.
Similiar functionality i have seen in google map navigation application.
Can you please tell me how create such feature?
If you are talking about matching places for a street address, this should work:
use reverse geocoding to convert it into (latitude, longitude) pair, both Android itself and Google API provides this service;
use Google Places API to obtain nearby places using the pair of coordinates
I have a project which actually does the similar job, while due to some reasons it is not public, but I can assure you this way could work.
Hope it helps.