Google Places API (Android) Autocomplete just like on Google Maps - android

I am working on an app in which there is a AutoCompleteTextView that returns suggestions when a user types in. Everything is working fine but I have noted that there is difference in suggestions comparing to maps.google.com. For example when I search "bakery near" in google maps it returns suggestions, but when I search same text on my test app (which uses Google Places API AutoComplete) it returns nothing. Please tell me how can I achieve the suggestions like maps.google.com.
Note: I don't want to show google maps in my app.
Google Maps Example: http://i.imgur.com/BiwzxoD.jpg ,
Google Places API AutoComplete Example: http://i.imgur.com/T4lQe7x.png
Your help would be highly appreciated.

For a query like, "bakery near ...", I believe you would want to use the Query Autocomplete web service. Though even with this I do notice some differences between the results on Google Maps and this web service. I suspect that Google Maps has custom logic that moulds the input/results to be a bit more intuitive.

Related

Perform Hardcoded search in Google Maps on Android App

I am making my first android app to track and manage medications.
One of the features I want to include is adding a page that says '"Find Local Pharmacies'.
What I want is very simple - when the user opens this page I want a map to appear with pins on all the places that matched the term 'pharmacy' (within say a 5km radius).
I have never used Google Maps API before so I don't know if this sort of thing is even possible - online searches suggest Google doesn't have a 'search' API, but is there any easy way to do this?
Thanks!
One option would be to use the Google Places API. I see they've got a place type of "pharmacy".

which api to use for an app providing list of nearby hospitals with available treatment types?

I am building an android app which can suggest a list of hospitals/clinics/doctors who specialize in specific division of medicine.
For e.g If a person searches for orthopedics, the app should list all nearby hospitals which specialize in orthopedics.
I am new to android development and have never used any api like the Google Map API or the Google Places API. I read that other vendors like yelp etc. don't have enough information about such services.
Can someone help me decide which API I should be using here?
Also, when do we use google map api vs a google places api ?
Links to tutorials explaining how to use these apis would also be very helpful.
Thanks in advance.
I would suggest using either the Google Places API like you have mentioned or the yelp API:
https://developers.google.com/places/android-api/start
https://www.yelp.com/developers/documentation/v2/search_api
I, have personally used the yelp API for a personal project of mine and it pretty much does what I want it to. Please look at the documentation in both the links above and see what fits your application the best (both should work based on the description you provided). Hope this helps!

Are there no existing Java classes for Google place autocomplete and maps directions?

I'm thinking of writing an app that make use of the places autocomplete and maps directions, but find it really odd that the Google docs for its only provides a rest api.
Am I having a brain fact, or are there truly no Places Autocomplete text fields provided via the SDK? and similarly for maps directions?
no brain fart. that's just how it is.
there is, however, a github project that's supposed to handle the rest api calls for you. haven't used it, so not sure if its any good.
The Web Services APIs can now be used in Java with this native client library: https://github.com/googlemaps/google-maps-services-java
No Places API unfortunately but the Directions API is in there.

Android Google Maps searching for places

I am new to Android development and I wanted to know about using the Google Maps API. What I am trying to accomplish is given the user a list of places defined here in Google Places API (https://developers.google.com/places/documentation/supported_types) table 1 only. When the user picks a supported type, I want to be able to get a list of all the corresponding places as an arraylist. For example, if I picked Hospital, I want to get a list of all closeby hospitals. I am not sure how to go about doing this. Can someone point me in the right direction? Any tutorials? Where can I start?
You can follow Google Places API Tutorial

How to show suggestion list on google map search?

I want to show suggestion list same as google maps application.
I found some api on google developer site but they dont return same result as google maps application.
https://developers.google.com/places/documentation/search#PlaceSearchRequests
check this screen shot for more.
Its finding using current location, my location is jaipur,rajasthan,india.
You need to use third party library API for this. FourSuqare provides the most efficient and largest database of location based API for this. IT uses type ahead. I would recommend to use their iOS SDK or Android SDK.
The also offer REST web services. Here is a complete documentation for the same.
What you are looking for is this API
You can use a handy library that utilizes the Google Places autocomplete API ... or you can "inspire" from here... https://github.com/chenyuan/SPGooglePlacesAutocomplete
The result:

Categories

Resources