25.02.2011 0:32, Serdel пишет:
Thanks Kostya, I was hoping to find something similar in the android api.
I'm not aware of anything read-made (except maybe down in the native code, and not accessible through the SDK).
The circular buffer is a solution although I think the fifo queue would be faster...or not?
FIFO is behavior, circular buffer is one possible implementation technique. So one can't really say that one is faster than another.
Need to reconsider that. I would definitely need to expand the size of the queue to avoid additional memory allocation, and avoid the Garbage Collector kicking during the recording process.
This is a common data structure. If you just Google for "circular buffer" or "fifo buffer", you'll see that there are various clever improvements that build on the basic idea.
Still, I think you could start with a basic circular buffer, and see where it takes you. You'd already be avoiding several bad thing with that: the need to box/unbox data, any dynamic memory allocations (except for resizing), copying data to "push down" after a get.
-- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en