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.
Related
I need help with my final CS Project. Basically, I have to write an Android app that the user can specify a starting location and distance desired. It is going to generate a route that is exactly the distance of the input that the user can walk/ run and brings the user back to the starting location, using the Graph data structure and Google API.
I have my Google map and Android app but I’m not sure where to start with storing data using Graph ( I'm not sure if I should even use this data structure) and how to calculate the distance input. Any bits of advice/ help will be appreciated!
Okay your question is very tricky but still let me answer from what I got.
Use google map api, google places api, place picker or id and google maps json api for routes and distance.
let's take an example like you want walk or run 4kms from your places and comeback.
Case 1: if you want to opt for the same route from which you went to come back.
like you went from a-b then again you are coming bak from b-a.
for this case you can use Google maps geofencing and get the place inside a minimum raidus and make an algo to get the distance from your places.
if teh distance is half of the distance from your places then pick the most approximate place.
Use google maps json to get the places distance and google place picker for the location of nearby location object.
Case2: If you donot want to come from the same route through which you went
by, then select the nearest location object and get the longest route and follow
the same algo and procedure to get the distance.
I am making an android application and I am thinking instead of having a database and input numerous universities and schools in our area, is it possible to use google map instead? For the user to just type the location and identify the nearest college and universities base on the location the user typed by the use of google map?
I'm not sure if there are any search features built into the Android SDK, but you can certainly still use the Place Search API.
The following example is a search request for places of type 'university' within a 500m radius of a point in Sydney, Australia:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?type=university&location=-33.8670522,151.1957362&radius=500&key=YOUR_API_KEY
You simply need to specify the type as university or school. See here for other supported types.
Use the google place api as follows
https://maps.googleapis.com/maps/api/place/nearbysearch/json?type=university&location="current lattitude","current longitude"&radius=500&key=YOUR_API_KEY
for more info visit https://developers.google.com/places/web-service/search.
I am working on an android app and want to implement checkIn feature in my android application.
I am using Google Places API for searching the nearby locations from the current location. I want the sorted results according to the locations, like If any location which is near I want that location to be shown first than other locations which are away.
I have searched a lot on this and checked the link
Place Search
I found the rankby parameter to be send in order to find the locations in ascending order by their distance from the current location.
So, we can pass the parameter with rankby=distance.
But we need to send some of the parameters from keyword, name or type. But I want to get all the results which are nearby to the current location. I cannot send any of these parameters, so how can I do it then. Please help if anyone know about it.
I want to develop an application for searching Near by places(restaurants, ATMs etc), Currently I am using Google Places API and it is working fine but the problem is it is not giving me the names of local restaurants present near to me or also giving some restaurants name which are far away from my current location.
All my local restaurants are present and shown on Google Maps in restaurant Category but not providing the same in nearby searches.
When I tries the same using application NearMe on play Store its is showing the proper data including all my nearby local restaurants and more precise results.
Is something needs to be done at coding level to get all these local restaurants data and more precise results or NearMe using some different API ?
I was having this same issue when working with the Google Places API. I was trying to grab the closest places within a specific radius and Google Places would return a random assortment of places within that radius as opposed to the closest 5 or so places.
I did find a very rough work around that might work in your case. I noticed that by tightening up the search radius or distance I received closer places in my query (obviously). But this was the only way I could get the closest places that I knew existed within the API that were close to the current location.
Check out this post that is the same issue.
Google Places Api sort by distance
I was wondering how I can channel or simulate Google Maps just in the sense of a user types in a location in text, such as a restaurant name and a city name. Then Google suggests 5 or so places they have indexed, and presumably they know the GPS coordinates because Google then puts them on a map. I want to be able to use that feature- not the map, just getting the location.
My goal is for a user to type in a query, 5 options or so to be shown, and if they user chooses one of them, then the GPS coordinates, or a location object, is saved representing that place.
Ideally I could just send the query to Google and steal the results back to my app. Obviously building my own database of locations and an algorithm to suggest them is out of the question.
Thanks for the help and advice in advanced!
Note 1: To clarify, this does NOT involve the current position of the user/device.
Note 2: I looked at the Google Maps add-on API, but it looks like that is for a visual map, not the querying a location part. You are already supposed to know your location, and it will map it.
Use geocoder.getFromLocationName, you get back a list of Address objects, in those objects you will find all the information you need about the location.
To test this on the simulator you need an image with the Google APIs included. In a device should be fine if you have the market installed.