Java 如何在android中使用服务器发送的事件(SSE)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22032031/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use server sent events (SSE) in android?
提问by zella
How to use server sent events (SSE) in android client application? Is there a java library for that?
如何在 android 客户端应用程序中使用服务器发送的事件 (SSE)?有没有一个java库?
采纳答案by zella
I use eventsource-javalibrary. It's works perfectly on android.
我使用eventsource-java库。它在android上完美运行。
回答by Vikas Rathod
I am not sure but you can always try, capture your sse using javascript and as android have support for html5 it will work.
我不确定,但您可以随时尝试,使用 javascript 捕获您的 sse,并且由于 android 支持 html5,它会起作用。
Refer this: http://developer.android.com/guide/webapps/webview.html
请参阅:http: //developer.android.com/guide/webapps/webview.html