为什么在项目中使用不同的 Google API 键?

Why use different Google API's keys in project?

我正在使用其他人创建的 Google 地图 API 开发 Android 应用程序。项目有不同的模块,如客户端、client_developer、client_preproduction等,但它们都在其他模块中共享核心代码。 我不明白为什么在 google_maps_api.xml 中他有不同的 API 键 "debug key"、"release key"、"test key"。 如果 API 的工作只需要一把钥匙,他为什么要这么做?

您需要使用数字指纹 SHA-1 对您的应用进行签名:AndroidSDK 工具会根据您的目的生成不同的证书,即如果您需要测试您的应用,生成调试证书,或者如果您想要发布您的应用程序,请生成启动证书以将其放在 google 上播放。您可以在这里阅读更多内容:https://developers.google.com/maps/documentation/android-api/signup

希望对您有所帮助! :)