03-05-2010 05:52 AM
Take a look at the sample application FileExplorerDemo that comes with the BB JDE.
03-05-2010 06:31 AM - edited 03-05-2010 06:42 AM
Thank you for your replay!
i checked that I not getting it perfectly
I'm learning to develop a program to read a files from SDCARD
plz give me other solution of this
03-05-2010 07:42 AM
please take a look at the solution in this thread. It tries to open a file stored on the SD card. It is in a very simple form:
hope that helps
03-05-2010 08:22 AM - edited 03-05-2010 08:41 AM
i dont like open file from SDCARD but
i want to devlope application like: -> In listfield set all files which is In SDCARD
how can i get all file name from SDCARD?
03-05-2010 09:38 AM
I'm going to reiterate that you should look in the FileExplorerDemo application that comes with the JDE.
More specifically, look in the FileConnection class you'll see that there is a method called list() and a method called getName(). The list() method will return a list of all the files that are in the current directory so if you open a FileConnection in SDCard it might return a list like this:
Notice that item number 2 has a "/" at the end to indicate that it is a directory. So if you want to find all the files in it you'll have to open a FileConnection to it and call the list() method on that connection. To get just the file name and not all the path information open a FileConnection to a file and call the getName() method on that connection. Here's how you should probably approach this.