Finding route with HERE offline - android

I want to find a route with HERE but offline.
The target of the route should be human readable text (like Berlin) and not latitude/longitude values.
Now I'm using RoutePlan class which requires lat/long values, and I'm using Geocoder to translate readable text to lat/long values.
But in offline mode (no WiFi, no Cellular Data) I can't use Geocoder to get the lat/long of a place.
How nonetheless can I use HERE maps in offline mode to find a route?

Are you using the HERE android SDK? If so, you most certainly can.
What you need are two things:
1: Download some maps via our MapLoader APIs.
2: Set MapsEngine#setOnline(false) to change the engine to offline only mode.
Geocoding will work offine if the data is downloaded. Routing, guidance and and map rendering will work too.

In addition to David Leong's answer, I had to use HERE's GeocodeRequest instead of Geocoder to get the latitude and longitude.
Example at https://developer.here.com/mobile-sdks/documentation/android-starter/topics/geocoding.html

Related

Launch here wego application via intent using street address (No latitude, longitude)

In my application, I have to use a map application to navigate to a destination. I'm using Here wego application for this purpose. I have my street address with me. From the documentation, I could see that it is possible using intents by providing a data URI with the latitude and longitude of that destination.
But I need to launch the application just by using this destination's street address not by converting it to lat long. Is there any way to achieve this?
If it doesn't exist in the documentation then it is probably not possible, also a solution like that is bound to introduce some bugs through ambiguity as there could exist multiple streets with the same name or a slight typo in the input.
I would recommend jumping through the extra hoop of implementing a google maps autocomplete or converting your address to a latitude-longitude form purely because of possible bugs even if the option existed.
You can first use the HERE geocoder API to get the geo-coordinates of your destination and then use it to construct the data URI.
See:
https://developer.here.com/documentation/android-premium/dev_guide/topics/geocoding.html
Alternatively you can use place ID from the places API:
https://developer.here.com/documentation/android-premium/dev_guide/topics/places.html

API to determine whether the co-ordinate given is a road or a building?

We are creating an app on traffic monitoring and handling congestion. We want to know if there is a way we can find out about the place if it's a road or building using the Co ordinates
You can use The Google Maps Geocoding API's reverese geocoding service.
Example of Reverse Geocoding
The following query contains the latitude/longitude value for a location in Brooklyn:
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY

how to check a point is accessible through road (Android)

i'm getting latitude and longitude of a location, I want to know the roads connecting to that location and whether it is land or water
I tried one google map api which is not helping to get the information i want.
http://maps.google.com/maps/api/geocode/json?latlng=40.7127,74.0059&sensor=true
Another SO answer pointed out two possible workarounds:
You can use Google Maps Reverse Geocoding . In result set you can determine whether it is water by checking types. In waters case the type is natural_feature. See more at this link http://code.google.com/apis/maps/documentation/geocoding/#Types.
You can detect waters/lands by pixels, by using Google Static Maps. But for this purpose you need to create http service.
You can use the Google Maps Geocoding API which does exactly that: http://code.google.com/intl/da-DK/apis/maps/documentation/geocoding Take a look at the "Reverse Geocoding" section

how to retrieve region and province from gps android

I'm new to android programming and I'm wondering if it's possible and how to retrive from the current position (I don't even know how to retrieve it) the region and the province.
Could you please post some code or tell me where I can find it?
Thanks!!!!!!
Matteo
GPS TRACKING IN ANDROID PHONE:
You can retrieve current location of the mobile phone using Android Location Manager.
Tutorial Reference: GPS Tracking
REVERSE GEOCODING WITH AVAILABLE LAT LONG:
For getting the region and province, after getting current lat/long from phone, you can use the google reverse geocoding API that can be consumed via web-service.
The Google Reverse Geo-coding API is : https://maps.googleapis.com/maps/api/geocode/json?
Usage would be a GET REQUEST like : https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452
(You won't get a response if you just copy and paste the URL in browser)
(API Key is also not required for limited usage)
Reference : Reverse Geocoding
First, find the location of your user using the Location Manager.
Then, pass the location to Google's Geocoder for the address (it contains the state, province and more)
You can also use the methode of Geocode class's (android.location) : http://developer.android.com/reference/android/location/Geocoder.html

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/

Categories

Resources