×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    48

    Write Permission!

    Hello everybody.
    I'm trying to save some data on my phone using file connection.
    I added the permissions:

    javax.microedition.io.Connector.file.write
    javax.microedition.io.Connector.file.read

    and in my app i do:

    FileConnection fconn=(FileConnection) Connector.open("file:///Memory Card/"+fileName);
    if(!fconn.exists())
    fconn.create();
    OutputStream fos=fconn.openOutputStream();
    fos.write(data,0,data.length);
    fos.flush();
    url=fconn.getURL();
    fconn.close();

    But when i do Connector.open i get the following exception:

    Security Exception: Permission = javax.microedition.io.Connector.file.write

    I really don't know why??I can even change directory but i'm not able to write anywhere.
    Can someone help me?
    Thanks

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Write Permission!

    Please make sure that you added the permissions in both JAD and MF.
    While prompting for the security question while midlet is running(and trying to access files), have you allowed to access files?

    Regards
    Gopal

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    48

    Re: Write Permission!

    Yes.When the midlet prompt the message I allow that.
    Anyway,I added the permission using the Wireless Toolkit
    In the manifest i have:

    MIDlet-1: RFCOMMClient, RFCOMMClient.png, MainMIDlet
    MIDlet-Name: RFCOMMClient
    MIDlet-Permissions: javax.microedition.io.Connector.comm,javax.microed
    ition.io.Connector.file.write,javax.microedition.io.Connector.file.read
    MIDlet-Vendor: Fabio
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0

    and the permissions are present...also in the jad file.
    I actually can't access to any of the directories on the phone.
    I also tried with the private MIDlet's directory but it still doesn't work.
    I noticed that if I try to access to a not public directory i get Access Denied while for the directories to which i should be able to access i get the Security Exception..

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

    Re: Write Permission!

    What carrier are you using (I mean is your device from a carrier - which one)?

    Also have you tried out the example midlet in FileConnection introductory doc? http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html

    Hartti

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    48

    Re: Write Permission!

    Sorry but I'm not english..What do you mean for "carrier"?

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    48

    Re: Write Permission!

    I also noticed that the mobile doesn't prompt me the request for writing but only for reading.That is,if i do:

    .........Connector.open(path,READ_WRITE);

    Only the permission for reading is prompted.
    And in fact if i do:

    .........Connector.open(path,WRITE);

    No permission is asked and I get the Security Exception i've described.
    It' s like the mobile doesn't want to prompt me the request for writing!!

    What could it be??
    Last edited by Paranoid_Android; 2006-07-04 at 08:53.

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

    Re: Write Permission!

    carrier = operator
    Which company is your cell phone operator?

    Hartti

  8. #8
    Registered User
    Join Date
    May 2006
    Posts
    48

    Re: Write Permission!

    The phone was in a Vodafone box ... it has the Vodafone brand on even if I don't use Vodafone but TIM.

  9. #9
    Registered User
    Join Date
    May 2006
    Posts
    48

    Re: Write Permission!

    I solved the problem!!
    It seems that it's a problem of the N70 firmware.
    It has changed the MIDlet suite settings deniyng the modification of user files.
    For anyone that have the same problem:

    Go to Menu->Settings->Manager and then select the midlet and change the permissions settings or the request for writing will not be prompted even if you add the permissions in the .jad !

    That's sick!! Everytime I install the MIDlet I've to change it manually :S

Similar Threads

  1. write text into file *.pho for MBROLA
    By jend_rommel in forum Symbian
    Replies: 1
    Last Post: 2005-11-14, 10:47
  2. write and read a TInt data from the file
    By billqu in forum Symbian
    Replies: 2
    Last Post: 2004-12-27, 15:10
  3. Replies: 0
    Last Post: 2004-04-16, 17:19
  4. Replies: 4
    Last Post: 2004-01-05, 08:47
  5. read and write Chinese menu in J2ME
    By walterzcm in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-13, 06:22

Posting Permissions

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