02-23-2012 04:53 AM
Good day.
Currentlry I work on an app that load several types of data (text, pdf, audio & video) with a large scatter in the size and saves it on the memory. Approaches are used for this aims is a legacy of ancient times: works correctly but maintained it is a hell. So I want to rewrite saving part and thinking how I can do that.
We can't save 30mb as on piece, aren't we?
We may save data as thousands objects in persistent store but with should use ObjectGroup. Right?
And as a case, we can "simply" serialize our data to memory. But I want to avoid this approach because this can rise a lot of issues when I try to calculated size of data in memory, moved, copy, play or compare these array of bytes.
What is the best way? All help wiil be appreciated.
p.s.
I should maintained version from 4 and above/
Solved! Go to Solution.
02-23-2012 05:00 AM
02-23-2012 05:12 AM - last edited on 02-23-2012 05:16 AM
Thank you for your reply, Simon.
Sorry, I don't explain my circumstances clearly. Now application saves data in file on SD card but it is also should work without card.
Can we save this data as one piece in persistent?
02-23-2012 05:24 AM
02-23-2012 05:39 AM
Yes, I read about that but I should somehow saving data if user haven't SD card. As I mentioned above app must work on old versio OS and, as I know, old devices haven't internal memory at all.
So, I have only one way: If SD card not exist put data in persistent object.
How large file can I put in one persistent object?
Should I use ObjectGroup before put data in store?
...
something else that I should know?
Thanks.
02-23-2012 05:58 AM
02-23-2012 06:28 AM
Yes, I try it.
02-23-2012 08:06 AM
Before you go too much further on this, I would review the internal memory available on the devices you are trying to do this for.
All devices post OS 4.2 can support SD Card.
All devices pre 4.2 will, I suggest, die if you try to store that amount of data on them. So I don't think what you are doing is feasible for these older devices.
And for devices OS 4.2 and above, I strongly suspect that it would be cheaper for you to buy an SD Card for any users who don't have one, than develop the code that will use the persistent store when the SD Card card is not available.
02-23-2012 09:02 AM
02-23-2012 09:44 AM
What do you mean by internal memory?
Some phones were capable of mapping their flash to look like an SD Card. But from memory, the user specified how much was actually mapped in this way. I think the default was a small amount. And it reduced the other memory available on the device.
BTW, I was wrong saying that all phones post OS 4.2 supported SD Card. In fact most did but not all. Most notably the 8700 did not (I used to love my 8700)
Anyway, here are few of the specs for phones that run OS 4.0 to OS 4.5. :
http://www.gsmarena.com/blackberry_7290-1348.php
http://www.gsmarena.com/blackberry_8700c-1349.php
http://www.gsmarena.com/blackberry_8700c-1349.php
http://www.gsmarena.com/blackberry_curve_8300-1979
Look at the memory. You can't expect even a 8300 Curve to cope with 50 MB stored in its flash.
Until you get to the OS 4.6 supported devices, I don't think there is enough memory on board to support your requirement in the flash store. And of course all these devices have card slots.
So I still suspect you are wasting your time trying to do this.