java - android studio中的API认证问题
问题描述
我是 Android Studio - Java 的初学者。我正在开发 Android 应用程序,将汽车动画显示为 Uber,当我尝试在 url 显示的模拟器中运行汽车动画时遇到问题
"error_message" : "You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account",
"routes" : [],
"status" : "REQUEST_DENIED"
}
我创建了一个 API 帐户并激活了计费帐户。此外,我将 API 密钥限制为 API 方向..
我的代码..
requestUrl = "https://maps.googleapis.com/maps/api/directions/json?"+
"mode=driving&"+
"transit_routing_preference=less_driving&"+"origin=-33.92873%2C18.458879&destination=-33.92873%2C18.458879&waypoints=-33.9403%2C18.666731"+
"key="+getResources().getString(R.string.google_directions_key);
Log.d("URL",requestUrl);//Print url to review by Chrome
Log.d("The destination is : ", destination);
我还使用了(服务器密钥(由 Firebase 自动创建))..
我搜索并尝试解决这个问题,但我不能,所有的解决方案都给我相同的结果..你能帮我解决这个问题吗?谢谢 ..
解决方案
推荐阅读
- python - 覆盖 libc open() 导致 python os.popen().read() 挂起
- couchdb - 从 CouchDB 数据库中清除所有非当前数据的推荐过程是什么?
- angular - 描述中定义的变量在角度测试的外部函数中是“未定义的”(jest/jasmine)
- android - Stripe Android - 为错误消息设置区域设置
- php - 使用 curl 和 crontab 执行 api 请求而不是正常工作
- python - 如何在 boto3 中使用 send_raw_email 指定回复?
- ruby-on-rails - Rails::TestUnitReporter 找不到 MiniTest::Result 测试的方法
- python-3.x - 生成二进制编码符号 Python 程序
- sql-server - 为其他用户禁用 SQL Server 登录弹出窗口
- r - 创建具有时间戳增量的数据框行