Google distance matrix web service limit - android

According to this Google document there are limits on using Distance matrix web service.
From the document :
Use of the Distance Matrix API must relate to the display of information on a
Google Map.Use of the service in an application that doesn't display a Google map
is prohibited.
I am not clear whether I meet this limit or not.
Let me explain how I use this web service. I call this api from server to get distance between locations. Using this distance I just decide that user1's entered location is near to user2's entered location or not. I don't use this information to display on google map. But at client side I display google maps with marker for user's entered location and markers for nearby users' location.
Using web service and google maps this way, do I satisfy the above mentioned limit?
Note : I also call direction web service at client-side to display routes on map.

MAPS API
Your usage is fine. I think the whole point of the Google guidelines you quoted above are to stop people using the distance matrix and other Google Maps APIs (without a Google MAPS API business account) from using it outside of any "app" scope for financial gain or in situations where there is a simpler solution that doesn't require their API. (I will get to this soon)
This is also the reason they impose lower limits on the numbers of API calls you can make per day when using a free Google Maps key:
Normal - 2 500 elements per 24 hour period.
Business - 100 000 elements per 24 hour period.
I've used many of the Google maps API services on free accounts across a broad range of applications, some that match the scenario you have state above, others that do not. We have never had a problem at all and as long as people use the API fairly, they shouldn't either.
Other ways
There are other ways of doing what you require. You could calculate the distance between the two locations using the Haversine Foruma
http://en.wikipedia.org/wiki/Haversine_formula
and then send this distance down to your app upon request. This would remove the need for the Distance Matrix API in some circumstances (I'm unsure how indepth your App and Web Services actually are).

Why not instead use straight line distance between two points?
Try to find something similar to Android's Location.distanceBetween in the language you use for your server or just port the code from Android.

Related

How to show alternative directions in Google Maps?

I have collected data of specific restricted zones in Google Maps. Now I want that when a user opens my app for getting directions for a Point B from Point A, he should be shown an alternative direction which does not include the restricted zones which I have mentioned.
How should I proceed?
What steps should I follow such that those restricted zones get ignored while showing alternative directions from Point A to Point B?
To get alternative direction, you can use the Google Maps Direction API which is a service that calculates directions between locations using an HTTP request.
You can use the optional parameters alternative to provide one or more alternative route.
alternatives — If set to true, specifies that the Directions service may provide more than one route alternative in the response. Note that providing route alternatives may increase the response time from the server.

Android App using accelerometer and Google Maps API

I want to develop an app that reads the accelerometric values(of the phone's accelerometer) and on passing a certain threshold value of accelerometer, it should send a message with the phones position in Google Maps co-ordinates.
Is this project technically feasible?
I can develop an app that reads accelerometer values but how to design it in such a way that sends a message of the phone's co-ordinates in Google Maps?
Your question is too broad to supply code for it, that you will have to do yourself, but here are the steps you will need to implement.
Set up a google maps activity/fragment. This is explained in detail on the google developer docs.
Receive an event when accelerometer value's are updated.
Based on the accelerometer values, determine whether or not threshold is passed. If yes proceed with 4&5, if not, exit and wait for new accelerometer readings.
Get a Location(lat/long) from the FusedLocationApi. This is explained in detail on the google developer docs.
Place a marker on the map with that Location. If there was already a marker from a previous reading, remove that one before adding the new one.

Navigating& providing directions to a user's GPS location

I've read Google's API policy on Location Services & Maps API, they do not allow one to make an app that provides directions to a user's location. I however wish to make such an app. I know I need to use a third party Maps API, but im unsure if this sort of app would be allowed on the play store.
I've searched extensively. The only references to this not being allowed in the the Maps API terms of service, but no where else. +
The idea is simple, one person sends a request to another, and they track each other with directions provided to find them.
Revalent reddit post by myself.
http://www.reddit.com/r/androiddev/comments/2qcm22/would_i_get_in_trouble_w_googles_policys_if_i/
I do not understand that it is difficult , you can use Google maps , first try to get another exact coordinates of latitude and longitude , and put them on a Google map , then make getting location via satellite.

How to enable traffic information along a specific route in Google Maps V2?

Google Navigation shows the traffic layer only for a given route. With GoogleMap.setTrafficEnabled(true) I'll get the traffic information for the whole map.
I know how to draw polylines for a route from Google Directions, but how can I turn on the traffic layer only for that route?
Not possible as of API v2 version 3.1.36. You may want to post a feature request on gmaps-api-issues.
The difference between these two values (duration and a duration in traffic) indicates how delayed your customer is going to be on their way to or from their location.
Reference: Access Google's Traffic Data through a Web Service
Discussion: http://searchengineland.com/pull-google-maps-traffic-data-into-adwords-with-this-script-library-248934

How to make an on-the-fly refresh on Google Maps v2

I'm using Services do calculating the LatLng from some addresses stored in a database. When I have a lot of addresses, it's slower to calculate and when I open Google Maps, it doesn't have all the Markers displayed on the screen, because the Service is still calculating in background. Is there a way to Markers appear automatically with the Maps still opened?
Thanks!
You should probably geocode the data when it is entered into the database instead of at the time it is displayed. As you have seen, geocoding is slow, and it would be better to cache the geocoded results. Or at least save the geocoded result the first time you encounter an address.
Note: Google has restrictions on what you can use its geocoding service for. If you used Google's geocoding, then you are only allowed to use that lat/lng with the Google Maps API.
There do exist free/open source geocoders. In my opinion/experience, Google's geocoders is better than the open source ones. (But it has restrictions.)

Categories

Resources