BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 06-01-2009, 03:05 PM   #1 (permalink)
Knows Where the Search Button Is
Join Date: Dec 2008
Model: 8800
Carrier: O2
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how to use FileConnection

Please Login to Remove!

I am trying to access a text file on my hard disk while working on the BB JDE and using the 8800 simulator. I am using the following code but i get the exception that the file does not exist.

PHP Code:
FileConnection filecon = (FileConnection"file:///SDCard/Blackberry/test.txt"); 
The file is located in the same folder as my project.
Is the filepath correct?

Thanks in advance
Old 06-01-2009, 07:41 PM   #2 (permalink)
BlackBerry Extraordinaire
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts

That code will only access the simulated SDCard for the simulator. Have a look at this KB article: How To - Use a computer file system as a microSD card
My other Blackberry is a PlayBook.

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