Does anyone know of an MQTT broker that runs on an Android smartphone? I tried to Google and found nothing, and on the app store there seems to be only one app with just 10 downloads, so I'm not sure how well it works.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Have a look at this question:
Using Android-Tablet as an MQTT-Server
TLDR;
Possible, have a look for a pure Java broker like HiveMQ.
Here is an MQTT broker library I have adapted to Android: https://github.com/interaktionsbyran/moquette You'll have to make your own Android app though, it is just a library.
https://play.google.com/store/apps/details?id=server.com.mqtt
Add these dependencies to the gradle
And use
to start broker server. the default URI is
tcp://localhost:1883
For me
server.startServer();
gave me exception as it is unable to create a fileBrokerConstants.DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME
. So, I changed the destination of theBrokerConstants.DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME
using this code below code and it worked for me.And Use Paho libraries for android
To create a client and connect to
tcp://localhost:1883
and subscribe for a topic and start publishing and receiving messages.moquette library for android.