FileConnection exception on Myphone device - does not have access to restricted API

I developed an application in J2ME in which I need to make a connection to a file, but when I run this application, it gives an exception:

Application not authorized to access the restricted API

I signed the assembly using the signature server and it works fine on another device besides this device. Below is my code for the same.

Below is my code to connect to the file. First it creates a file path

 String dir = "file://" + Util.get_root_dirFrom() + "m/demo.res"; // Filepath for the application
 Log.p("Inside the loadString method......dir");
 FileConnection fc = null;
 InputStream fis = null;
 try {
   fc = (FileConnection) Connector.open(dir, Connector.READ);// Make a file connection
   fis = fc.openInputStream();
 }catch(Exception ex){
   Log.p("Exception...."+ex.getMessage());
 }

Util.get_root_dirFrom() methods return the directory for the memory card in this device.

How to solve this problem?

+3
source share
2 answers

, .

​​ J2ME.
, , / .

, , , , , .

+1

, SmRndGuy . , io

0

All Articles