Reverse Geocoding in Android : Error "IOException:Service not Available" - android

My app is totally based on maps. The requirement is user need to enter the source and destination in words then i need to draw the route on map with those values with markers. Later on the displayed map with route drawn, the user able to change/modify the source or destination by dragging the marker which are displayed. Simultaneously the route drawn should also change dynamically with user's action.
I can get the lat & long from the map using onTouchEvent. But in the same map not able to set both source and destination.
And i tried reverse geocoding to get the lat & lon from given location names. But i get IOException:Service not Available. I was searching for solution, then i found this link which started in jun 2010, still no fix for this bug till now.
Please help.Also provide sample code.
Thanks.

Related

How can I use Graph data structure to generate route with exact distance using Google API in Android?

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.

Redraw route on map when user changes driving route

I'm working on an Android App which draws path on map using Polyline options, between source to destination.
This works fine.
What I need is, if user starts from source, and instead of taking drawn route towards destination, the user takes another route, the path on map should be redrawn for user's current path.
I'm using Directions API for drawing path.
I think, I'm required to use Google Navigation API. How can use that within my app, without having to navigate to Google Maps app?
First: Check if your current/last known location is near or falls on the path/route created.
Direction api: check if a place falls in the route path between 2 places
Second: If current/ last known location if outside or off the path/route created, send a request to get direction from the current location to the same destination.
OR
Try this
Turn by Turn navigation

How to draw path from current location to user entered location on map fragment?

I'm curious if there is a way to draw the path from a devices current location to a user entered location.From researching the only methods I have come across are to get path from lat and long coordinates like this solution http://blog-emildesign.rhcloud.com/?p=822 ,
My question is if there is a way to combine a users geo location and a user entered destination string to draw the path.I'm guessing this would involve reverse geo coding or am I wrong?
The current interface looks like this and I'm using Google maps API v2:
Look here for how to do a polyline in android map api v2 https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polyline
Tip save your line as a kml file for interoperability so other apps will be able to import the file and show the same line on a map.

Marking places in android app not on the 'Google Places' database

I want to add markers on map for my android app. I do know how to do it (overlay items). My question is: Since I am manually putting markers on points(on the map) whose lat/long's I already know, I want to know if there is any way to get the exact latitude and longitude of a place on google map? Right now I am asking my people to go to the particular places and use this ( http://bit.ly/K4fOcy ) app to determine the lat/long of that place and send it to me via e-mail. I use these lat/long values to put markers on my map in the app. But the latitudes and longitudes i get are not accurate. they have around 300-2500m error (on real scale).
Or shall I use the Google Places API? How does it work? What about the places which are not in the Google Places database? How do I exactly mark them on the map? I would be very grateful if someone points me in the right direction.
Thanks
If you are working with establishments that aren't represented in the Google Places API and want to be able to pull coordinates directly from http://maps.google.com/, you simply:
Find the location of interest on the map, using an address or just knowledge of the area
Right-click on the map and select What's here? from the context pop-up menu
The Lat-Lng coordinates will be automatically populated in the search input box and usually, the address will also be displayed in the dynamic side-panel (and very often a Street-View photo).
If you are looking for a way to query for the coordinates, you can use the Geocoderdev-guide service to turn addresses into coordinates.
Have you looked at the geocoding API for google maps? It allows you to pass in an address, and returns a Latitude/Longitude pair in response, there is an accuracy value returned with each response to let you know how close the geocoder was able to resolve the location. https://developers.google.com/maps/documentation/geocoding/

Select Map marker with reticle in android MapView?

My application requires that a user select a location on a MapView. I will be using Google Places API to place location markers on the map. There will be times however when a user might select a location, for example a fountain in a park, that IS NOT listed in the Places API. One option is to offer users a choice of selecting a location with a touch on a map, OR selecting map markers of known locations using two different maps for each activity. I think the perfect solution however would be to use one MapView that contains the mapmarkers but also allow the user to select a location that does not have an associated marker.
My thoughts were to apply a reticle in it's own Overlay that stays centered in the middle of the MapView despite scrolling and a select button to make the selection.
If the reticle is over a marker, for example, Sams Cafe', then the button would read "Select Sam's Cafe'", if the reticle isn't over any Map Markers, then the button would read "Select this location".
I am having trouble figuring out a way to verify the reticle is over a marker. Since the marker is limited to a single GeoPoint, it's going to be very difficult, frustrating and time consuming for the user to try and match the reticle center to the exact GeoPoint.
What would be optimal is a check to see if the reticle is over the Map Marker graphic. I presume this will utilize projections and bounds??
Two questions, How to do this if possible?
or, is there a better UI that I am overlooking that is much easier to achieve?
Thank you for your consideration.
If you use the way you saying is better than anyone, but why dont you keep away any user from any kind of geocoding. Like user selects the location through marker, on the basis of that user will confirm the location, if it has got any place then it will show the address or it will show the nearby location. e.g. let the user select the location from marker get the longs. and lats. , If user confirms that location then put it onto geocoding and get the location address, it will surely return an address maybe exact or nearby and if user likes it, user will confirm it, simple. Please notify if its not feasible way.

Categories

Resources