如何与后台服务在Android上使用socket.io? [英] how to use socket.io with background service on android?

查看:1284
本文介绍了如何与后台服务在Android上使用socket.io?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用gottox / socket.io-Java的客户端在Android上聊天app.And现在我想用socket.io作为背景service.In聊天应用程序如果有新的消息(聊天时,应用程序被关闭),发送如果你想看到像聊新消息通知这里的应用程序,请单击。
我该怎么办呢?我做了Node.js的聊天应用程序,gottox上android.But我需要这个应用程序的工作作为phone.Do后台服务您有任何插件或例子?

I use gottox/socket.io-java-client on android chat app.And Now I want to use socket.io as a background service.In chat app If a new message (when chat app is closed),send a notification like "new message on chat app-click here if you want to see. How can I do that? I did a chat app with node.js,gottox on android.But I need this app work as a background service on phone.Do you have any plugins or examples?

推荐答案

一个服务或任何其他Android组件可以通过操作系统关闭。该解决方案是使用Android通知唤醒任何部件。

A service or any other Android component can be closed by the operating system. The solution is to use Android notifications to wake up any component.

这篇关于如何与后台服务在Android上使用socket.io?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆