Search code examples
javajava-memobilesecurityexception

How to overcome file browsing exception in J2ME?


I have mobile application in which I have added mobile file browsing. But when ever I try to open some directory or some file, it raises exception that application is trying to access mobile data.

So how do I overcome this error? If somebody could also tell me that how overcome security exception while install the application?


Solution

  • Actually this is not an error. You are using JSR-75. So permission needed for accessing file from memory card or phone memory.

    This is not coding related issue. Basically this type of confirm alert asking for security purpose. Because you are using JSR-75.

    In this purpose, You need to sign your application with at least any 3rd party signature like one from Verisign or Thrawte and then go to the application settings - permissions - and set permission for "Access User Data" as "Ask only Once" or "Allow Always" (these settings might not be available for your unsiged app on the device.)

    If you facing this Issue on the emulator, go to preferences and MIDP tab, set the application domain to Trusted and set permission as "Allow Always". For more info, see here...

    Signing sites are,

    Thawte

    Verisign

    Java Verified