来自 android 个应用的流量持续时间
Duration in traffic from android app
我正在尝试从 Google 路线 API 获得回复,包括 duration_in_traffic
。在响应文档中有包含此值的条件,其中之一是
The request includes a valid Google Maps API for Work client and
signature parameter.
如果我理解 google APIs 正确,client+signature 是服务器-服务器(网络服务)调用中使用的身份验证方案,包含加密是个坏主意键入移动应用程序以生成签名。
那么,如何从 android 应用生成的请求中获取 duration_in_traffic
响应?我可以通过使用 Key for Android applications
表单 Google 开发人员控制台以某种方式使其工作吗?假设我需要 "Google Maps API for Work",如何为我的 Google 开发者控制台帐户启用它?
来自 Google Maps for Work 支持的明确答案:
The duration in traffic is currently only available to authenticated
Maps for Work requests, those that include a client ID and signature.
Unfortunately it is not possible to have this returned when requesting
directions in any other way. Additionally it is not possible to place
requests to any of the Web Services using an Android or iOS key.
These only function with the respective mobile APIs.
If you want to place requests for directions from a mobile device the
advisable way to achieve this is to proxy your request via one of your
own servers. Essentially the device sends the request to the server
(with some form of authentication if you so desire) and the server
then sends the Maps for Work request to us. Once it receives the
response this is sent back to the mobile device. By doing it this way
you do not expose your crypto key in order to mke the requests.
TL;DR: 无法从 android 应用程序使用,您必须使用您的服务器作为代理并实施自己的身份验证(以及速率限制、节流等) .) 注意你的配额
我正在尝试从 Google 路线 API 获得回复,包括 duration_in_traffic
。在响应文档中有包含此值的条件,其中之一是
The request includes a valid Google Maps API for Work client and signature parameter.
如果我理解 google APIs 正确,client+signature 是服务器-服务器(网络服务)调用中使用的身份验证方案,包含加密是个坏主意键入移动应用程序以生成签名。
那么,如何从 android 应用生成的请求中获取 duration_in_traffic
响应?我可以通过使用 Key for Android applications
表单 Google 开发人员控制台以某种方式使其工作吗?假设我需要 "Google Maps API for Work",如何为我的 Google 开发者控制台帐户启用它?
来自 Google Maps for Work 支持的明确答案:
The duration in traffic is currently only available to authenticated Maps for Work requests, those that include a client ID and signature. Unfortunately it is not possible to have this returned when requesting directions in any other way. Additionally it is not possible to place requests to any of the Web Services using an Android or iOS key. These only function with the respective mobile APIs.
If you want to place requests for directions from a mobile device the advisable way to achieve this is to proxy your request via one of your own servers. Essentially the device sends the request to the server (with some form of authentication if you so desire) and the server then sends the Maps for Work request to us. Once it receives the response this is sent back to the mobile device. By doing it this way you do not expose your crypto key in order to mke the requests.
TL;DR: 无法从 android 应用程序使用,您必须使用您的服务器作为代理并实施自己的身份验证(以及速率限制、节流等) .) 注意你的配额