gpt4 book ai didi

android - 我们如何找到 google_maps_api.xml 文件

转载 作者:太空狗 更新时间:2023-10-29 15:45:30 25 4
gpt4 key购买 nike

Get a Google Maps API key

Your application needs an API key to access the Google Maps servers. The type of key you need is a Key for Android applications. The key is free. You can use it with any of your applications that call the Google Maps Android API, and it supports an unlimited number of users.

Choose one of the following ways to get your API key:

The fast, easy way: Use the link provided in the google_maps_api.xml file that Android Studio created for you:
Copy the link provided in the google_maps_api.xml file and paste it into your browser. The link takes you to the Google

Developers Console and supplies information via URL parameters, thus reducing the manual input required from you. Follow the instructions to create a new project on the console or select an existing project. Create an Android API key for your console project. Copy the resulting API key, go back to Android Studio, and paste the API key into the element in the google_maps_api.xml file.

我想知道我们如何找到该文件。它位于何处?

最佳答案

在 Android Studio 3.0+ 中,当您签署 apk 时,release 和 debug 文件夹不包含任何 google_maps_api.xml。我不知道为什么?

但你只是简单地将元数据放在 AndroidManifest.xml 中

   <meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/API_KEY"/>

并正确签署您的 apk,- 设置包名- Google 开发者控制台的 SHA1 key (此处需要上传 key Google 的应用签名 key )

查看我的详细答案: https://stackoverflow.com/a/49692374/1978475

关于android - 我们如何找到 google_maps_api.xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34960315/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com