Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User chinnu_p's Avatar
    Join Date
    Jul 2009
    Posts
    48
    Hi,

    I have a problem when try to read a file in the cell phone. I just put in my MIDLet the API permissions (javax.microedition.io.Connector.file.read, javax.microedition.io.Connector.file.write) but when I try to write the file i have an error.
    the code is the following:
    String path="file:///C:/Gallery/Test.txt";
    FileConnection fc=(FileConnection)Connector.open(path,Connector.WRITE);
    if(!fc.exists()){
    fc.create();
    }
    DataOutputStream dos = fc.openDataOutputStream();
    String s = "data";
    dos.write(s.getBytes(),0,s.length());
    dos.close();
    fc.close();
    } catch (Exception e) {
    e.printStackTrace();
    }

    when i run the code i get a question : "You want allow that the application read data in: Gallery . This application isn't by secure provider".....ok, that's allright! But when I say "yes" get java.lang.SecurityException: Access denied!!!!!!!!!!!!!



    Someone can help me?

    Thank you.

  2. #2
    Regular Contributor dinanath.d's Avatar
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189
    Hello,

    You cannot access all the images/folders in your device, but can access a set of folders that the device/OS permits to access from a Java application.

    Hope you have gone thorugh "MIDP: FileConnection API Developer's Guide (with Example) v2.0"
    http://www.forum.nokia.com/info/sw.n..._0_en.zip.html

    You can access the files only if your device supports JSR 75 - FileConnection. You can see the JSR support of different Nokia devices here.
    http://www.forum.nokia.com/devices/matrix_all_1.html
    Regards,
    Dinanath


    It's a matter of attitude.

  3. #3
    Registered User chinnu_p's Avatar
    Join Date
    Jul 2009
    Posts
    48
    my phone is supporting jsr-75 still file opening tine security exception is getting
    plzzzz help me this is very argent form

  4. #4
    Regular Contributor dinanath.d's Avatar
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189
    Hello,

    Try to put this Test.txt in some other folder than Gallery.

    May be
    String path="file:///C:/Test.txt";
    Regards,
    Dinanath


    It's a matter of attitude.

Similar Threads

  1. Getting around midlet signing for JSR-75.
    By Timmmm3d in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-12-14, 23:19
  2. Tranfering file by bluetooth
    By hassan83 in forum Python
    Replies: 5
    Last Post: 2008-04-18, 17:01
  3. Problem with ensymble_python2.5-0.26.py in linux
    By tansualpcan in forum Python
    Replies: 2
    Last Post: 2008-04-15, 10:12
  4. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Python
    Replies: 35
    Last Post: 2008-01-17, 09:12
  5. S60 theme questions
    By Nokian_Spb in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2006-08-17, 06:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved