'A' Object have very big boolean array.
'A' length is at least 150.
I want to save 'A' in device, and load quickly.
It should be load at least 1 second.
I have no idea how to do.
Using realm(https://realm.io) can be possible?
Is there no way to save java instance and load?
Sorry for my poor english.
150 items of boolean are small amount of data for conventional mobile devices. You can save more than 1000 items at once within 1 second.
Realm already supports
byte as a datatype. You can use it by converting boolean array into byte array.
As you know,
boolean is just 1-bit(binary) data. There's lots of case to handle such bits, but for me, I love to handle it in naive manner.
Let say you have 160 items of boolean.
1 hex string contains 4 bits.
1010 1110 0110 1100can be expressed into
160 bits can be converted into
Just save 40 length strings to Realm or
Want to load? no problem. Convert 40 length strings into 160 length boolean array.
I think it could consume less than 100ms as those converting process is pretty fast in modern mobile CPUs.