×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    14

    Access a file in C drive of symbian phone in J2ME

    Hi,
    Could some help me in accessing a file present in C drive of N73 device.
    The same folder is readable and writable to python code, but my jar file is not able to access it. I am getting Access denied error.


    Regards,
    Kishan.

  2. #2
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Access a file in C drive of symbian phone in J2ME

    Quote Originally Posted by krishnakishan_c View Post
    Hi,
    Could some help me in accessing a file present in C drive of N73 device.
    The same folder is readable and writable to python code, but my jar file is not able to access it. I am getting Access denied error.


    Regards,
    Kishan.
    I think in j2me one can't write a file to drive directly wat u r doing but U hav to work in folders for eg c:\test\test.text rather than c:test.txt
    Regards,
    Saurabh

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    14

    Re: Access a file in C drive of symbian phone in J2ME

    Hello qi210xi,
    I had asked is there is any way to access a file in C drive using J2ME API.
    As far as i understand, i could not see any relation to the answer that u have replied.

    Please do not give any abstruse replies.

    Thanks sourabh for ur reply.
    See the problem is: Using python a folder is created say "test" and the file "test.txt" is saved in the test folder.
    Now if i am accessing the file using J2ME API like this::
    FileConnection fc = (FileConnection)Connector.open("file:///C:/test/test.txt");
    InputStream is = fc.openInputStream();
    I am getting access denied error.
    Pls give me your suggestions on this.
    Last edited by krishnakishan_c; 2010-01-07 at 05:05.

  4. #4
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Mumbai
    Posts
    199

    Smile Re: Access a file in C drive of symbian phone in J2ME

    hi frnd,
    by Using Fileconnecton API you can acess data C: or PhoneMemory of Mobile Phone.
    Try it.

    thanks
    Ajay Prajapati
    Mobile Software Developer
    Mumbai,India

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    14

    Re: Access a file in C drive of symbian phone in J2ME

    Thanks for reply ajay,
    There is a file excludelist.txt in C drive of my device.
    But when am reading content using the FileConnection, i am getting access denied error.
    FileConnection fc = (FileConnection)Connector.open("C:/excludelist.txt");
    Could you pls give me ur valuable suggestions..

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Access a file in C drive of symbian phone in J2ME

    Some information here
    http://library.forum.nokia.com/index...82070821D.html
    You have access to only certain directories from MIDlets

    Hartti

  7. #7
    Registered User
    Join Date
    Jan 2010
    Posts
    14

    Re: Access a file in C drive of symbian phone in J2ME

    Thank you very much Harrti,
    It is mentioned as ::

    ******************************************************************************
    “For S60, access rights of MIDlets is to Designed public directories and files therein” means all directories defined by File API System properties and the whole file system of memory cards and hard drive except for system/ and private/ directories.

    File API also contains the “restricted access to the directory” concept. This is needed if a user starts to navigate, for example, from root to c:/data/Images/ directory (the fileconn.dir.photos property points to that directory). The user has only a restricted access to the c:/ root and c:/data/ directory. This means that the user has only read access rights to the data/ directory. The list() operation returns only those directories/files to where the user has access.

    The user can create/modify/delete files and sub-directories under the c:/data/Images/ directory, but cannot change the name of the c:/data/Images/ directory. This restriction concerns all directories that are pointed to by a File API system property.

    ******************************************************************************
    So apart from C:/DATA/Images folder, we can not access any other folder using FileConnection class right??
    My doubt is, if i create a folder say "test" & a file "test.txt" inside DATA folder of C using NOKIA PC Suite, i am still not able to access it (C:/test/test.txt) from midlet. why??

  8. #8
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Mumbai
    Posts
    199

    Smile Re: Access a file in C drive of symbian phone in J2ME

    hi frnd,

    this is not way to access phoneDrive of Device.

    FileConnection fconn = (FileConnection)Connector.open("file:///c:/newfile.txt");
    use like this..


    thanks
    Ajay Prajapati
    Mobile Software Developer
    Mumbai,India

  9. #9
    Registered User
    Join Date
    Jan 2010
    Posts
    14

    Re: Access a file in C drive of symbian phone in J2ME

    Thanks for your reply ajay.
    In fact i had created a file "test.txt" under a folder "test" in C drive using NOKIA PC Suite and tried to access the same way u had suggested like ::
    FileConnection fc = (FileConnection)Connector.open("file:///C:/test/test.txt");
    But still it is giving Access denied error.
    i am not sure why????
    Could you pls give your suggestion on this???

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Access a file in C drive of symbian phone in J2ME

    Because, as the document Hartti directed you to says, MIDlets have only limited access to the file system. This is to prevent MIDlets you install on your phone from accessing your personal information.

    You must store information in one of the permitted folders in the file system.

    If you only want to read the file, try specifying Connector.READ when you open the connection. Some parts of the file system are accessible to MIDlets, but read-only.

    Graham.

Similar Threads

  1. J2Me application to access Message Senders' phone number
    By tractorman in forum General Messaging
    Replies: 0
    Last Post: 2009-12-11, 13:36
  2. Replies: 0
    Last Post: 2009-11-22, 19:03
  3. Replies: 1
    Last Post: 2008-01-12, 11:42
  4. access to native phone file system
    By Sumantra in forum Symbian
    Replies: 3
    Last Post: 2005-10-03, 15:49

Posting Permissions

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