I developed application in J2ME in which I have to make a file connection, but when I run this application it gives an exception:
Application not authorized to access the restricted API
I signed the build using the signing server and it works fine in other device except this device. Below is my code for the same.
Below is my code for file connection. It first constructs the filepath
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 dir for memory card in this device.
How to resolve this issue?