[英]How to know if an android device is turned off from the server?
Can I ping the android device from the server to know if it is turned off? 我可以从服务器ping android设备以了解它是否已关闭吗? I think there is no way to ping the server before the android device turns off.
我认为在android设备关闭之前无法对服务器执行ping操作。 Particularly I will be doing this in node js
特别是我将在节点js中执行此操作
Thanks if you can guide me to the right path. 谢谢您能引导我走正确的道路。 Thanks!!
谢谢!!
You could maintain a persistent connection using a Faye server. 您可以使用Faye服务器维持持久连接。 That way, you will get to know when your device switches off.
这样,您将了解设备何时关闭。 As a fallback, use an sms confirmation, just in case the network is not down.
作为备用,请使用短信确认,以防万一网络没有中断。
Node.js example here. 这里是Node.js示例。 https://github.com/faye/faye
https://github.com/faye/faye
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.