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
Posts: 3
Registered: ‎10-06-2008
My Device: Not Specified

Is "file://store/home/user/" writable across all BB device types?

I need a standard place to write files to (using FileConnection) on multiple 4.2 Blackberry device types.  Will "file://store/home/user/" do the trick?

 

Thanks,

 

Ferrol Blackmon

Developer
Posts: 46
Registered: ‎07-12-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

I haven't found any documentation that says "store/home/user" is always available, but we are using that path to write files and its been tested on the Curve, Pearl, and 8800 series devices.  I've also tested against the 9000 and Pearl Flip simulators. 

 

I would be interested in a RIM or J2ME method that gives me this 'application folder path'.  I seem to remember a post pointing to a knowledge base article that describes some system properties that give paths to the picture folder, etc...but as I recall those properties are only available until 4.3.

BlackBerry Development Advisor
Posts: 15,813
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Is "file://store/home/user/" writable across all BB device types?

You could also create a directory for your application to store its files in.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 46
Registered: ‎07-12-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

Actually, that is what I'm doing...I create a subfolder under store/home/user/{myappnamehere}.

 

Is there an API that will give the "store/home/user" path.  What I've found is that if I try to create files or folder's directly under "store" I get errors (its been a while so I don't remember the exact errors).

 

 

New Developer
Posts: 3
Registered: ‎10-06-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

Thanks ryandevore,

 

I was using the pictures directory until I could find something more reasonable.

 

Ferrol

New Developer
Posts: 3
Registered: ‎10-06-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

Yes, that was exactly my problem.

 

frb

Highlighted
Developer
Posts: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000

Re: Is "file://store/home/user/" writable across all BB device types?

/store/home/user is not always available.  On pre-OS 4.6 devices you could not mount the /store/home/user directory as a USB mass storage device.  On the 9000 you can mount /store/home/user, which will immediately cause a FileIOException if you are writing to that path.

 

I have found it necessary to write data across several partitions depending on what is available. I give highest priority to /SDCard, then /store/home/user, then /system.  Of course, /system is not available on all platforms, so you have to check which file system roots are available before you start writing data. 

Earl Oliver
Developer
Posts: 558
Registered: ‎11-25-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

Is System.getProperty available in 4.2????

 

If so, thats where you get your path's from....look at System in the javadocs and look at the fileconn.xxx keys.

 

-D

Developer
Developer
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

Even if you get the path from the system properties, as eaoliver states, on devices with 4.6 or higher, they won't be available if mass storage mode is turned on.

 

Developer
Posts: 558
Registered: ‎11-25-2008
My Device: Not Specified

Re: Is "file://store/home/user/" writable across all BB device types?

I was able to connect to the SD card filesystem when I had mass storage enabled. However, it's not on until USB is connected. You can load your app from the PC to the device. THen UNPLUG the USB cable and run your app. It should run just fine.....does on my storm.

 

-D