简体   繁体   English

如何在Android中使用Google Direction API

[英]How to use Google Direction API in Android

At first really sorry for asking a stupid question. 起初,真的很抱歉问一个愚蠢的问题。 Is it necessary to generate API key to use Google Direction API in my Android Application. 是否需要生成API密钥才能在我的Android应用程序中使用Google Direction API。 How to generate Google Direction API key? 如何生成Google Direction API密钥? Link of any documentation is preferred. 首选任何文档的链接。 Thanks in advance. 提前致谢。

Firstly There is no such thing in this world as a stupid question. 首先,这个世界上没有一个愚蠢的问题。

Secondly go through this documentation you will find what you need 其次, 浏览本文档,您将找到所需的内容

EDIT VERSION : Follow these steps. 编辑版本:请按照以下步骤操作。

open this link 打开这个链接

  1. Create a test project. 创建一个测试项目。 2.click API&auth on left menu 2.单击左侧菜单上的API&auth
    3.click credential 4.Create new key on the public API access section . 3.单击凭据。4.在公共API访问部分创建新密钥。 Then create a key. 然后创建一个密钥。

or esle use this key which i just generated for a sample project. 或esle使用我刚刚为示例项目生成的此密钥。

AIzaSyDZOj1QSw4MM4RzPdUEeNTLEhlntcyfMqw AIzaSyDZOj1QSw4MM4RzPdUEeNTLEhlntcyfMqw

Using an API key has the following effect: 使用API​​密钥具有以下效果:

This means, the usage of the api on all devices your app is installed on, is summed together. 这意味着,将在您安装了应用程序的所有设备上使用api的总和。

If you do not use the API key, the usage is per IP-address. 如果不使用API​​密钥,则按IP地址使用。 So the limits of the API apply per device. 因此,API的限制适用于每个设备。

On a server you have to ability to cache (or use other techniques) to minimize calls. 在服务器上,您必须能够缓存(或使用其他技术)以最小化呼叫。 But on a device (IMHO) this ability is limited. 但是在设备(IMHO)上,此功能受到限制。

In my apps, I use the Direction API without API-key, so I do not bump into usage limits. 在我的应用程序中,我使用了没有API密钥的Direction API,因此我没有遇到使用限制。

BTW: you can get an API key using the Google Developers Console . 顺便说一句:您可以使用Google Developers Console获取API密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Xamarin Forms和Google Direction API android - How to use Xamarin Forms and Google Direction API android 我们可以在Android中使用网络服务Google Direction API吗? 如果可以,如何在地图中显示多点? - Can we use web services google direction api in android? If so how can I show the polypoints in a map? 如何在Android Google Maps Direction API中实际计算距离和持续时间? - how distance and duration actually computed in android google maps direction api? Android Google Direction API,如何忽略单行道 - Android Google Direction API, How To Ignore One Way Street 如何使用谷歌方向api响应在地图上显示驱动道路 - how to use google direction api response for displaying drive road on the map 在 android 中使用谷歌方向 api 进行 GPS 跟踪 - Gps tracking using google direction api in android Google Maps Android V2和Direction API - Google Maps Android V2 and Direction API 在Android中与Google Direction API保持距离 - Getting distance from Google Direction API in Android android 的 Google Direction API 是免费的吗? - Is the Google Direction API for android is free of cost? 如何在使用谷歌方向API时检测方向 - How to detect direction when using google direction API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM