Google端点和Google Cloud Messaging

时间:2021-01-17 23:12:44

I am building a mobile app with a backend using google app engine, I'm using google endpoints for API calls. Now what I am wondering is if there is a possibility to use GCM on the same backend. At the beginning When I wanted to create a new module using android studio, I only found the possibility to create a backend with endpoints and another one with GCM, but nothing with both of them. Any clue? Thanks.

我正在使用谷歌应用引擎构建一个带有后端的移动应用程序,我正在使用谷歌端点进行API调用。现在我想知道的是,是否有可能在同一个后端使用GCM。一开始当我想使用android studio创建一个新模块时,我只发现了使用端点创建后端的可能性和使用GCM创建另一个后端的可能性,但两者都没有。任何线索?谢谢。

1 个解决方案

#1


5  

Google Cloud Messaging (GCM) is a service that allows you to send push notifications from your server to your users' Android devices, and also to receive messages from devices on the same connection.

Google云消息传递(GCM)是一项服务,允许您将推送通知从服务器发送到用户的Android设备,还可以从同一连接上的设备接收消息。

Whereas Google Cloud Endpoints consists of tools, libraries and capabilities that allow you to generate APIs and client libraries from an App Engine application, referred to as an API backend, to simplify client access to data from other applications.

Google Cloud Endpoints包含工具,库和功能,允许您从App Engine应用程序(称为API后端)生成API和客户端库,以简化客户端对其他应用程序数据的访问。

So these are two separate techniques. But Google has provided a bridge between these two services with a github project that demonstrates:

所以这些是两种不同的技术。但Google通过github项目提供了这两个服务之间的桥梁,该项目演示了:

  • Setting up the Backend
  • 设置后端
  • Debugging the Backend Locally.
  • 在本地调试后端。
  • Connecting your Android app to backend.
  • 将您的Android应用程序连接到后端。
  • Registering devices with GCM backend.
  • 使用GCM后端注册设备。
  • Testing device registration in emulator.
  • 在模拟器中测试设备注册。
  • Showing Push Notification from GCM backend.
  • 显示来自GCM后端的推送通知。
  • Deploying backend live to app engine.
  • 将后端部署到应用引擎。
  • Finally, testing against a deployed backend.
  • 最后,针对已部署的后端进行测试。

Just click this link to get the github source code.

只需单击此链接即可获取github源代码。

#1


5  

Google Cloud Messaging (GCM) is a service that allows you to send push notifications from your server to your users' Android devices, and also to receive messages from devices on the same connection.

Google云消息传递(GCM)是一项服务,允许您将推送通知从服务器发送到用户的Android设备,还可以从同一连接上的设备接收消息。

Whereas Google Cloud Endpoints consists of tools, libraries and capabilities that allow you to generate APIs and client libraries from an App Engine application, referred to as an API backend, to simplify client access to data from other applications.

Google Cloud Endpoints包含工具,库和功能,允许您从App Engine应用程序(称为API后端)生成API和客户端库,以简化客户端对其他应用程序数据的访问。

So these are two separate techniques. But Google has provided a bridge between these two services with a github project that demonstrates:

所以这些是两种不同的技术。但Google通过github项目提供了这两个服务之间的桥梁,该项目演示了:

  • Setting up the Backend
  • 设置后端
  • Debugging the Backend Locally.
  • 在本地调试后端。
  • Connecting your Android app to backend.
  • 将您的Android应用程序连接到后端。
  • Registering devices with GCM backend.
  • 使用GCM后端注册设备。
  • Testing device registration in emulator.
  • 在模拟器中测试设备注册。
  • Showing Push Notification from GCM backend.
  • 显示来自GCM后端的推送通知。
  • Deploying backend live to app engine.
  • 将后端部署到应用引擎。
  • Finally, testing against a deployed backend.
  • 最后,针对已部署的后端进行测试。

Just click this link to get the github source code.

只需单击此链接即可获取github源代码。