Android java支持绑定Service和Activity之间的FIFO数据传输吗?
我对将活动绑定到服务并在不使用处理程序的情况下传输数据感到非常兴奋。也就是说,我想使用 FIFO 在事件驱动的基础上不断地将流数据从我的服务传输到我的活动之一。这一切都在一个应用程序中。
那天我一定缺席了 Java 101。但从那时起,我想我已经阅读了有关服务和活动之间对 FIFO 的支持的内容。我听到“绑定的东西”只是一声嗡嗡声。但我不知道如何在服务和活动之间可靠地传输数据。所以我想我需要一个 FIFO——非常好的一个。它可以是内置的、内置的或来自第三方。
我期望找到的是事件驱动的支持。你知道,服务有数据,而不是忙着等待,而是做一些诸如同步之类的事情,以及当我在其中时从服务到活动的非阻塞传输。我在这里有一个关键部分还是什么?这似乎是一个具有经典解决方案的经典问题。
请原谅我的眼镜丢了,但我儿子确实校对了这篇文章。感谢您的任何帮助。
请帮忙。
I'm all excited about binding an activity to a Service and transferring data without using a handler. Namely, I would like to use a FIFO for continually transferring streaming data from my Service to one of my Activities on an event driven basis. This is all within one application.
I must have been absent that day in Java 101. But since then I think I have read about support for FIFO's between a Service and Activity. I got the "bound thing" just a hummin'. But I can't figure out how to transfer the data reliably between a Service and an Activity. So I think I need a FIFO - really good one. It can be built-in, built-on, or from a third party.
What I was expecting to find was event driven support. You know, the Service has data and instead of busy waiting, do something like synchronization, and non-blocking transfers from the Service to the Activity while I'm at it Do I have a critical section here or what? This just seems like such a classic problem with a classic solution.
Pardon me I have lost my glasses, but my son did proof read this. Thanks for any help.
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是最终的工作结果:
1. 与服务绑定
2. 传递一个处理程序
Here's what ended up working:
1. Binding to the service
2. Passing it a handler