简体   繁体   中英

Reconnect MQTT client in android

I am using mqtt paho library in my android app. It works properly until mqtt client lost connection due to network problem. Do I need to connect client manually or it has some mechanism to connect automatically.

you will have to register resources so that mqtt library can handle mqtt client reconnect by itself when network reconnect happens. You can check this answer , it should help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM