BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-08-2009, 04:37 AM   #1
andreware
New Member
 
Join Date: Jul 2009
Model: 9500
PIN: N/A
Carrier: None
Posts: 3
Default Where should I store application data files?

Please Login to Remove!

In application I'm working on I need to store several data files. These data files should be unpacked on first start and them periodically updated from web.

I'm developing for Storm (9500, 9530). I expected to have private directory for application. As I understand "fileconn.dir.private" is not supported by System.getProperty() on BlackBerry.

Is there application private directory at all and how to find path to it?
Or where should I store application data files?
Offline  
Old 07-08-2009, 05:13 AM   #2
hippocamp software
Thumbs Must Hurt
 
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: T-Mobile
Posts: 67
Default

use a persistentstore class: RIM Device Java Library: Class PersistentStore
Offline  
Old 07-08-2009, 05:40 AM   #3
andreware
New Member
 
Join Date: Jul 2009
Model: 9500
PIN: N/A
Carrier: None
Posts: 3
Default

I considered PersistentStore, but I don't want to use it for two reasons:
  • As I understand it is designed as a way to serialize/deserialize objects to/from device. Thats not exactly where my needs are. These data files fall into several objects of different classes when data is read.
  • More important that I'm porting this functionality from Android version of application and want to keep architecture of both projects as close as possible.

Anyway thanks for spending your time on my problem.
Offline  
Old 07-08-2009, 07:58 AM   #4
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Did you look at FileConnection?

It is in the API docs.
Offline  
Old 07-08-2009, 02:16 PM   #5
andreware
New Member
 
Join Date: Jul 2009
Model: 9500
PIN: N/A
Carrier: None
Posts: 3
Default

Yes, I'm using FileConnection to work with files (retrieve input and output streams, check file existence, create/delete directories and files).

I need to know where should I store private files. For example, on Android each application has private directory where it is recommended to store data files and there is API method that returns path to this directory. Is there something similar on Blackberry?
Offline  
Old 07-08-2009, 10:03 PM   #6
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

Never come across any such directory. PersistentStore is the way to go, if you want to stay close to file semantics save them as a Hash of Strings with Strings as the key.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-19-2009, 10:52 PM   #7
Sparkletron
New Member
 
Join Date: Aug 2009
Model: none
PIN: N/A
Carrier: none
Posts: 1
Default

Quote:
Originally Posted by hrbuckley View Post
PersistentStore is the way to go
PersistentStore seems appropriate for long-term persistence. But what if you just want to save temporary files? I see that System.getProperty("java.io.tmpdir") returns null. And there's no File.createTempFile() method. PersistentStore could still be used for this but is it the best practice?
Offline  
Old 08-20-2009, 08:01 AM   #8
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

It depends. It is a compromise between work to encode/decode objects and memory and object handles available for the stores.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-21-2009, 12:42 AM   #9
shraddha294
Thumbs Must Hurt
 
shraddha294's Avatar
 
Join Date: Oct 2007
Location: Hyderabad
Model: 8800
PIN: N/A
Carrier: TMobile
Posts: 111
Default

Quote:
Originally Posted by andreware View Post
I need to know where should I store private files. For example, on Android each application has private directory where it is recommended to store data files and there is API method that returns path to this directory. Is there something similar on Blackberry?

unlike Android, no private directory. I had a similar issue and we created our own directory structure and stored data in encrypted form to disallow other applications from using the data. Depending on size of data you may decide between persistent store and file connection.
If you've already found a solution to ur issue, please share it on the forum
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM Battery for MacBook Pro 17

OEM Battery for MacBook Pro 17" A1309 A1297 Early 2009 Mid 2009 2010 MC226

$36.90



NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch picture

NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch

$31.90



A1618 NEW OEM Battery for MacBook Pro 15

A1618 NEW OEM Battery for MacBook Pro 15" Retina A1398 Mid 2015 020-00079

$43.90



NEW OEM A1618 Battery for Apple MacBook Pro 15” Retina 99.5Wh A1398 Mid 2015 picture

NEW OEM A1618 Battery for Apple MacBook Pro 15” Retina 99.5Wh A1398 Mid 2015

$43.90



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$37.90



Genuine OEM A1417 Battery For Apple Macbook Pro 15

Genuine OEM A1417 Battery For Apple Macbook Pro 15" Retina A1398 2012 2013 NEW

$38.90







Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.