You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
What do you think of adding the ability to read an input stream from a tray item and write to a tray item using an outputstream ?
(Ideally there would be no transformation of the binary stream to get higher speed levels).
Actually, it would help to serialize and parse Pojos encoded with whatever format devs want (I would use it for JSON, but protobuf would also work, etc..)
thanks for your efforts on this lib guys !
The text was updated successfully, but these errors were encountered:
No transformation of the binary stream for more speed is impossible. tl;dr Everything needs to be passed to a different process. Please read this for more infos about Binder and the ContentProvider.
Another thing: Tray isn't fast (and it will never be fast) by design. If you want something fast use the SharedPreferences but you will lose the multiprocess support. That in mind, it is properly not a good idea to store complex data structures in Tray unless it is very important for the data to stay in sync and persisted between different processes. Otherwise it would be a better idea to use a seperate database or a simple file for the data.
There is also a Binder limitation of ~2mb per transaction (visible in logcat as !!! FAILED BINDER TRANSACTION !!!). This means you can't save unlimited data per key.
But I see some cases where persisting a byte[] or a stream could be useful. I hope it does not get abused 😒.
No transformation of the binary stream for more speed is impossible. tl;dr
Everything needs to be passed to a different process. Please read this #28 (comment)
for more infos about Binder and the ContentProvider.
Another thing: Tray isn't fast (and it will never be fast) by design. If
you want something fast use the SharedPreferences but you will lose the
multiprocess support. That in mind, it is properly not a good idea to store
complex data structures in Tray unless it is very important for the data to
stay in sync and persisted between different processes. Otherwise it would
be a better idea to use a seperate database or a simple file for the data.
There is also a Binder limitation of ~2mb per transaction (visible in
logcat as !!! FAILED BINDER TRANSACTION !!!). This means you can't save
unlimited data per key.
But I see some cases where persisting a byte[] or a stream could be
useful. I hope it does not get abused [image: 😒].
—
Reply to this email directly or view it on GitHub #33 (comment).
Hi Tray team,
What do you think of adding the ability to read an input stream from a tray item and write to a tray item using an outputstream ?
(Ideally there would be no transformation of the binary stream to get higher speed levels).
Actually, it would help to serialize and parse Pojos encoded with whatever format devs want (I would use it for JSON, but protobuf would also work, etc..)
thanks for your efforts on this lib guys !
The text was updated successfully, but these errors were encountered: