android - API 项目在 Google Developers Console 中缺少项目 ID

标签 android api google-api google-cloud-messaging google-play-services

enter image description here

如您所见,我在 Google Developers Console 中的一个项目缺少项目 ID。虽然它指定了项目名称。 (我的项目仅为测试目的而创建)。 “API 项目”用于我的 Android 应用程序中的 Google Maps v2 Android API。我的问题是:

  1. 是否可以通过某种方式将该 ID 提供给项目?
  2. 我想在我在“API 项目”下开发的完全相同的应用程序中使用 Google Cloud Messaging API。我应该为此创建另一个项目吗? (不确定单个 Android 项目是否可以通过不同的 Developers Console 项目访问各种 API)
  3. 如果这里不可能有多个项目,我是否应该担心他丢失 ID? (注意:正如我上面提到的,存在项目编号,尽管在许多教程中它也被称为项目 ID)。在阅读了多个有关连接到 Google Cloud Storage 的错误:“缺少项目 ID” 的帖子后,我感到很担心,因为我不确定提到的是哪个 ID。

最佳答案

感谢您的回答,他们对我进行进一步研究提供了很大帮助,现在我对我的问题有了准确的答案:

Is it possible to somehow give that ID to the project?

是的,是的。 项目 ID 是一个可选标识符,您可以将其分配给自己的项目。有时它恰好在不是手动创建的旧项目中丢失。此 ID 由 Google Cloud SQL 等服务在需要访问您的项目资源时使用。在启用需要 ID 的服务之一之前,您无需为项目分配 ID。如果您的项目还没有 ID,请注册一个 ID:

  1. 打开注册对话框。执行此操作有两种选择。您可以在需要项目 ID 的 Services Pane 中启用服务。 (无法提前判断给定服务是否需要项目 ID;如果您启用服务并且它需要 ID,则会出现该对话框。)第二个选项:在 Overview Pane 中,找到 Project ID 行,然后单击 Register 链接。
  2. 在文本框中输入新的项目 ID。有关 ID 中允许使用哪些字符的详细信息,请参阅文本框下方的说明。
  3. 项目 ID 在您的域中必须是唯一的。为确保您输入的 ID 未被使用,请单击“检查可用性”按钮。如果出现一条错误消息,指出该 ID 不可用,请选择一个新的。
  4. 输入可用 ID 后,点击“选择此 ID”按钮。

I want to use the Google Cloud Messaging API in the exactly same application I am developing under "API Project". Shoud I create another Project for that? (Not sure if single Android project can acess various API's through diferent Developers Console projects)

这个问题的答案由上面的答案提供:

You can use one project to manage all of your applications, or you can create a different project for each one. In deciding whether to create a new project, consider whether you're collaborating with a different set of people, want to track usage differently, or would set different traffic controls for each application. If so, segregating applications by project in the Console might make sense. You can create as many projects as you need, but please remember that you cannot use multiple projects to try to exceed the limits for API usage by your application.

因此,如果偶然在技术上可行,则不推荐这样做。

If it is not possible to have several projects here, should I be worried about the missing ID? (Note: as I mentioned above Project Number is present, although in many tutorials it is referred also as Project ID). I am worried after reading several threads about Error connecting to Google Cloud Storage: 'missing project id' because I am not sure which one ID is being mentioned.

在使用 Google Cloud Messaging API 时,如果缺少 project ID 应该没有问题。只有特定的 API(例如 Google Cloud SQL,如上所述)才需要它,在这种情况下,一旦您在项目中启用了这些 API,弹出的对话框窗口就会强制执行手动创建。

关于android - API 项目在 Google Developers Console 中缺少项目 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22799765/

相关文章:

android - 如何在Android中使用Parse实现RecyclerView的无限滚动

python - EnumDisplayDevices 提供两个显示器,即使我有一个

c# - NativeApplicationClient 和 OAuth2Authenticator 未解析

iphone - iOS Google Plus API - 无需转到 Safari 即可共享或登录

android - AppWidget 中的 GridView View 回收

安卓工作室 : how to properly use the support library AppCompat?

ios - Spotify 获取所有用户的播放列表

android - 如何使用改造处理 JSON 数组对象?

ios - Google api key 不适用于我的 ios 应用程序

java - 套接字停止发送消息但不超时