×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Smile FileConnection Issue

    Hi,

    I'am trying to read an image file using the FileConnection api. The following is the code used.

    FileConnection fc = (FileConnection) Connector.open("file:///C:/Trac/tmp.jpg", Connector.READ_WRITE);

    This resides in a try - catch block.
    When this is executed, I get an exception with message Access Denied. But if I try to read from the E: drive it is successful. I have this error on both N73 and N82. Is there any restrictions on accessing the c: drive from Java ME ? Does it need to be signed ?

    Regards,
    Jaak

  2. #2
    Registered User
    Join Date
    Mar 2006
    Posts
    32

    Re: FileConnection Issue

    Hi,

    When you are accessing the "E:" you are accessing the contents of "Memory card" for which generally access is not restricted. but when you are accessing "C:" you are accessing the phone memory on which there are generally the restrictions based on device security model. Generally for device's default files we are not allowed Connector.READ_WRITE(i.e you can not write on those files).

    Try using Connector.READ instea,if you have a requirement of only accessng the contents and not changing them.

    Regards,
    Aditya

  3. #3
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  4. #4
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Smile Re: FileConnection Issue

    Hi,

    Thanks for both the replies

    Regards,
    Jaak

  5. #5
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Smile Re: FileConnection Issue

    Hi,

    My requirement is only to read the file. So Connector.READ would suffice. But even with Connector.READ, I still get the access denied error. It seems I have no options but signing the application. I wonder what is the purpose of these kind of restrictions. Even with Symbian c++, a self signed application can read and write to the phone memory. I know there are ways to access standard folders in the phone, but that is not what I want.

    Regards,
    Jaak

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: FileConnection Issue

    Well I would rather recommend that you should use the Fileconnection API for this kind of the issues.Always use that demo or the the code in order to have the File Connection details, like the Paths and all.So please install the PDAP demo available in the WTK's app folder.And you will come to know that what are the paths you can access and hence you can change the code in the same fashion.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Smile Re: FileConnection Issue

    Hi,

    Thanks for the response. I did try to run the pdapdemo application. But both the midlets in the suite failed to start on my N82. What I would like to know is that, is the access denied message, the expected behaviour with unsigned applications while trying to access the phone memory. If so, I would try to use a standard folder like dir.photos.

    Regards,
    Jaak

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: FileConnection Issue

    Quote Originally Posted by 1xuname1x View Post
    I did try to run the pdapdemo application. But both the midlets in the suite failed to start on my N82.
    Regards,
    Jaak
    It should not fail,
    what is the alert/message/exception on the screen?
    Did you change the setting of the application by going application manager -> Suite setting and then read/edit/write user data, change the setting as "allow"?
    if not then please do it and check this.

    Quote Originally Posted by 1xuname1x View Post
    What I would like to know is that, is the access denied message, the expected behaviour with unsigned applications while trying to access the phone memory.
    Regards,
    Jaak
    Well that the natural behavior of the app, in order to get rid of this there is nothing related to signing.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Smile Re: FileConnection Issue

    Hi,

    As I said earlier, the applications doesn't even start. It may be exiting as soon as it starts. There are no messages on the screen. There are only three options available in application manager->app->settings. 1. Software installation 2. Online Certificate 3. Default web address. Pardon me, but I didn't understand the second part of your response.

    Regards,
    Jaak

  10. #10
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: FileConnection Issue

    I think that there is some device issue with your device.If you don't mind then can you test the same pdapDemo on some other device.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  11. #11
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Smile Re: FileConnection Issue

    Hi,

    Thanks for the response. But I can read and write files to phone memory using Symbian c++ and I can run other j2me applications. I can run my own j2me application which successfully access the memory card. So I don't think anything is wrong with the phone. But will I test on couple of other phones. But I think, to be reliable, it is better to use one of the standard folders.

    Regards,
    Jaak

  12. #12
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: FileConnection Issue

    Yeah that's also the way...you can check that too.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. S60 5th Beta SDK Issue?
    By Nitesh Bhardwaj in forum General Development Questions
    Replies: 5
    Last Post: 2011-01-08, 21:54
  2. Nokia 6300 Bluetooth Connectivity Issue
    By flar74 in forum Bluetooth Technology
    Replies: 1
    Last Post: 2008-04-03, 20:19
  3. Realtime Fishing LBS Content's becoming a Hot Issue.
    By viva99kim in forum News and Announcements
    Replies: 1
    Last Post: 2008-02-29, 23:49
  4. Solved: USB IRDA issue with 3360 and 6360 for Win98 & Win2K
    By Vicman in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-05-07, 05:34

Posting Permissions

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