Google Cloud.发布/订阅Android应用

编程入门 行业动态 更新时间:2024-10-27 00:33:44
本文介绍了Google Cloud.发布/订阅Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试通过发布/订阅库将数据发送到GoogleCloud中的主题

I'm try to send data throught pub/sub library to my topic in GoogleCloud

projects/navigator-cloud/topics/navigator-location

这是Google地图的一个项目,其中包含建筑物的叠加层图像,我应该使用它.我想发布包含以下信息的JSON: {"Username":"oscarhmg","Location":"labproto","Timestamp":"2016-12-04T15:29:05Z"} .

Here is a project of a google map with a overlay image of a building, which I should use. I want to publish a JSON with some info like this: {"Username": "oscarhmg", "Location": "labproto", "Timestamp": "2016-12-04T15:29:05Z" }.

当主题收到此信息时,建筑地图中会显示一个标记(此地图在我的应用程序中以网络视图显示).该功能已经实现,我仍然不了解的是如何通过我的android应用程序传递消息以发布有关此主题的消息.任何帮助将不胜感激

When the topic receive this info, in the building map appears a marker(This map shows in my application in a web view). This functionality is already implemented, what I still do not understand at all is how to pass the message to publish on this topic through my android application. Any help would appreciate it

推荐答案

查看此Android Things教程,该教程使设备无需通过Web服务器即可直接将消息发布到Google Cloud Pub/Sub.进行身份验证的方法是在Android应用中构建.json凭据.

Check out this Android Things tutorial that has the device directly publishing messages to Google Cloud Pub/Sub without going through a web server. The way to do the authentication is by building the .json credential into the Android app.

github/androidthings/weatherstation

更多推荐

Google Cloud.发布/订阅Android应用

本文发布于:2023-11-24 11:16:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624984.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Google   Cloud   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!