Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
delta_foxtrot2
Posts: 38
Registered: ‎01-21-2009
My Device: Not Specified

Best way to store data

I have a few projects up my sleve at present where, for example a geocaching app, which may not be able to contact a server if I'm out in a national park looking for a cache, however I want/need to be able to store potentially hundreds of locations on the phone and be able to link to photos on the phone's memory.

 

Some geocaching locations have been around a while and can be 20kB or 30kB in size each if all the user log data is stored too.

 

What is the best way to deal with such blobs of data, both long term storage, as well as being able to retrive and display the information the most efficiently?

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Best way to store data

I recommend to use FileConnections API and store your data in files.

 

Persistent Store is not good choice because you need to store hundreds objects and there is limited persistent object handles (it is device OS limitation). On some devices your application can cause errors in this case.You can group and ungroup objects but it will affect on performance.

 

Check the link below

 

Blackberry Memory Best Practices Book

Please use plain text.
New Developer
delta_foxtrot2
Posts: 38
Registered: ‎01-21-2009
My Device: Not Specified

Re: Best way to store data

The problem with JSR-75 is of course speed, wonder if a hybrid approach would be better.
Please use plain text.
New Developer
delta_foxtrot2
Posts: 38
Registered: ‎01-21-2009
My Device: Not Specified

Re: Best way to store data

I remember the other issue with JSR-75, well part of the reason it's so slow, lack of random access.
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Best way to store data

If you wish to implement a hybrid solution - consider caching approach.

 

PersistentStore is fast cache, File system - is slow storage.

 

There are a lot of resources about cache management design pattern.

 

Try to google: design patterns cache management

Please use plain text.