Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Contributor
Gleichmut
Posts: 7
Registered: 02-22-2012
My Carrier: developer
Accepted Solution

How we can save a large data (~30-50 MB) on our device?

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/ 

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: How we can save a large data (~30-50 MB) on our device?

i would suggest that you save the files to SD card (as files). why serialize an object that you retrieve in a serialized form already?

for the download itself i suggest to read
http://supportforums.blackberry.com/t5/Java-Development/Download-large-files-using-the-BlackBerry-Mo...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
New Contributor
Gleichmut
Posts: 7
Registered: 02-22-2012
My Carrier: developer

Re: How we can save a large data (~30-50 MB) on our device?

[ Edited ]

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?

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: How we can save a large data (~30-50 MB) on our device?

i would rather save the data on the internal file system than use the persistant store, it is not designed to save large amounts of data.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
New Contributor
Gleichmut
Posts: 7
Registered: 02-22-2012
My Carrier: developer

Re: How we can save a large data (~30-50 MB) on our device?

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.

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: How we can save a large data (~30-50 MB) on our device?

objectgroup is used to group objects that are accessed at once, for example a contact from the address book.

i don't have any experience in this area, maybe you just try it?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
New Contributor
Gleichmut
Posts: 7
Registered: 02-22-2012
My Carrier: developer

Re: How we can save a large data (~30-50 MB) on our device?

Yes, I try it.

Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: How we can save a large data (~30-50 MB) on our device?

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. 

Please use plain text.
New Contributor
Gleichmut
Posts: 7
Registered: 02-22-2012
My Carrier: developer

Re: How we can save a large data (~30-50 MB) on our device?

Thanks for your answer, Peter.

Let me clarify: on all phones with OS version >=4 internal memory avaliable, right? If so, can I ask you about average size of internal memory on these devices or how I can check it in code?
Thanks.
Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: How we can save a large data (~30-50 MB) on our device?

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.php

 

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. 

 

Please use plain text.