在android中使用MQTT的基本步骤 [英] Basic Steps for Using MQTT in android

查看:34
本文介绍了在android中使用MQTT的基本步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Android 新手,想使用 MQTT 作为来自服务器的 Android 推送通知程序.
我读过 MQTT 但不太了解.如果有人使用过这个库,请告诉我我必须做什么才能开始使用它.

I am new to Android and want to use MQTT as push notifier for Android from Server.
i have read about MQTT but does not understand well. if any one has used this library so plz tell me what i have to do to start using it..

我有一个 Java 服务器(在 Windows 上运行)和许多客户端(将安装我的应用的安卓手机).我的服务器会随时向所有或某些特定客户端发送消息.

i have a Java Server (Running on Windows) and lots of Client(android phones on which my app will be installed). My server will send message to all or some specific clients at any time.

我的基本要求是什么?我的意思是在那里

what are my basic requirement ? i mean is there

  1. 服务器要求?
  2. 某种注册?
  3. 要包含在 android 中的库?
  4. Android 设备标识符?(因为 C2DM 要求每台设备都使用 Google 帐户)

请在这方面帮助我

推荐答案

您需要:

  1. 在服务器端运行的 MQTT 代理.这可能类似于开源的 mosquitto 代理.
  2. 一个 MQTT 客户端库,它包含在您的 Android 应用程序中,使您的应用程序能够连接、订阅和发布消息.http://mqtt.org/software
  3. 列出了许多 Java 选项
  4. 想出一种唯一标识用户或设备的方法,然后将其用作主题,以便您可以单独向一台设备发布消息.

Dale Lane 在这方面写了一个很好的指南 (http://www.dalelane.co.uk/blog/?p=1599),还有一组很好的关于 MQTT 的资源(https://github.com/mqtt/mqtt.github.io/wiki)

Dale Lane has written a nice guide on this (http://www.dalelane.co.uk/blog/?p=1599) and there is also a good set of resources about MQTT (https://github.com/mqtt/mqtt.github.io/wiki)

这篇关于在android中使用MQTT的基本步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆