Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以在原生 Android 应用程序中使用服务器发送的事件?
您可以,但您必须自己实现规范的解析、重新连接和其他部分。
这不是太繁重;您需要在 http 库之上构建,该库允许您处理通过网络传入的字节。我已经构建了一个解析 SSE 流的Python 库,并且基于Requests构建。您应该能够用 Java 编写类似的东西。