简体   繁体   English

如何知道服务器是否关闭了android设备?

[英]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.

相关问题 如何判断Android设备是否已关闭 - How to tell if android device has been turned off 如何锁定设备,但防止屏幕在android中关闭? - how to lock device but prevent the screen to be turned off in android? 如何知道飞行模式在 BroadcastReceiver 中是打开还是关闭? - How to know if Airplane Mode is TURNED ON or TURNED OFF in BroadcastReceiver? 在Android中关闭屏幕时如何防止CPU“休眠”? - How to keep CPU from 'sleeping' when screen is turned off in Android? Android Xamarin 应用程序 - 如何在设备屏幕关闭然后重新打开时维护表格 state? - Android Xamarin app - how to maintain form state when device screen is turned off then back on? 即使关闭autoRotation,也可以获取Android设备方向 - Get android device orientation even when autoRotation is turned off 如果设备关闭,是否可以访问Android HCE应用程序? - Can I access Android HCE application if device is turned off? 只有关闭wifi才能连接Android设备 - Android device connect to wear only if wifi is turned off 如何检查Android应用程序是否已关闭? - How to check whether the Android application is turned off? 设备关闭时的处理程序和可运行状态(Android) - Handler and runnable while device has been turned off (Android)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM