×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    2

    Problem N95: listing local files

    Hi,

    I am developping a J2ME application who needs to list the local files in a directory. In order to do that I use:

    private static final String directory="file:///Memory card/Images/";


    and later:


    cg=new ChoiceGroup("Choose a File to Send:",Choice.POPUP);

    FileConnection root=(FileConnection) Connector.open(directory, Connector.READ);

    Enumeration files=root.list();

    root.close();


    while(files.hasMoreElements()) {
    cg.append(files.nextElement().toString(), null);
    }



    It works properly on the emulator but in the N95 it blocks in the "while loop".

    Any ideas?

    Thank you very much for your help.

    Roberto Guerra

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    2

    Re: Problem N95: listing local files

    Solved. I have used "e:/" instead of "Memory card/". It's strange because I was able to read files but not to list the content of a folder.

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Problem N95: listing local files

    I wouldn't hardcode any paths, though.

    Sticking to this list: http://www.forum.nokia.com/document/...79F5BE26E.html

    plus values returned from "listRoots()" would be ideal.

    Daniel

Similar Threads

  1. GameCanvas size problem on N95 device
    By kalgik in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2008-04-02, 08:46
  2. linking error
    By dakosurf in forum Symbian
    Replies: 1
    Last Post: 2008-03-27, 22:45
  3. linking error
    By dakosurf in forum Open C/C++
    Replies: 0
    Last Post: 2008-03-27, 09:20
  4. Problem with include files when invoking from the command line.
    By RobertAlm in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-11-07, 13:38
  5. problem linking more than 23 C++ files
    By Corfa in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2005-09-16, 14:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •