java.lang.securityexception Applicatiion not authorized to access restriced
Hello,
I'm creating a midlet, when I execute the midlet in my phone I get a java.lang.securityexception Application not authorized to access the restricted api.
My phone is MIDP 2.0, CLDC 1.1 it has MMAPI 1.1, it supports audio capture.
I suspect one of these lines causes the problem
p= Manager.createPlayer("capture://audio?encoding=audio/amr")
p.realize();
rc = (RecordControl)p.getControl("RecordControl");
but i'm not sure which line since i don't have an emulator for my phone. Below is a part of the code.
Thread thrd = new Thread()
{
public void run()
{
try {
// Create a DataSource that captures live audio.
int index= listBox.getSelectedIndex();
String enc="";
if(index == 0)
{
p= Manager.createPlayer("capture://audio?encoding=audio/amr")
enc = "AMR";
}
p.realize();
rc = (RecordControl)p.getControl("RecordControl");
output = new ByteArrayOutputStream();
rc.setRecordStream(output);
rc.startRecord();
p.start();
showAlert("Recording","Using the " + enc + " encoding");
} catch (Exception ex) {
showExceptionAlert(ex,null);
ex.printStackTrace();
}
}
};
thrd.start();

