[英]Web socket and push notifications android
I have a web socket that I need to receive information from in my android app. 我有一个网络套接字,我需要从我的android应用程序中接收信息。 Would keeping a single web socket open at all times drain the battery on my android device? 是否始终保持打开一个Web插座会耗尽我的android设备上的电池电量? I expect that this web socket will only send notifications once every 24-hours, which is why I would like to close the connection, and somehow convert the web socket into a push notification. 我希望该Web套接字每24小时仅发送一次通知,这就是为什么我想关闭连接,并以某种方式将Web套接字转换为推送通知的原因。 But, then I also need to be able to send from the android app to subscribe to the web socket and receive push notifications. 但是,然后,我还需要能够从android应用发送以订阅Web套接字并接收推送通知。 How can I go about doing this? 我该怎么做呢?
I recommend using push notifications, which consume less battery of your phone and even more if you only send data once every 24 hours. 我建议您使用推送通知,这样可以减少手机电池的电量,如果每24小时仅发送一次数据,则消耗更多电量。
What technologies you plan to use? 您计划使用什么技术?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.