Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 41
Registered: ‎04-10-2009
My Device: Not Specified
Accepted Solution

controlled Access Exception while caputuring sound

hi, 

 I am getting  "net.rim.device.api.system.ControlledAccessException" when i am tring to capture the sound on device , here is my code

 

try {

// Create a Player that captures live audio.

_player = Manager.createPlayer("capture://audio");

_player.realize();

// Get the RecordControl, set the record stream,

_rcontrol = (RecordControl) _player.getControl("RecordControl");

//Create a ByteArrayOutputStream to capture the audio stream.

_output = new ByteArrayOutputStream();

_rcontrol.setRecordStream(_output);

_rcontrol.startRecord();

_player.start();

} catch (final Exception e) {

UiApplication.getUiApplication().invokeAndWait(new Runnable() {

public void run() {

Dialog.inform("Erroe : "+e.toString());

}

});

}

 

 I am tesing my application on JDE 4.6.1 blackberry curve 8900. 

Thanks, 

 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: controlled Access Exception while caputuring sound

Edit Application permissions.. Make sure all the permissions are set to allow..

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 41
Registered: ‎04-10-2009
My Device: Not Specified

Re: controlled Access Exception while caputuring sound

Hi , 

 

thanks it's works , but  can we edit the permission by putting some code.

 

thanks ,

  

 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: controlled Access Exception while caputuring sound

No that exactly not possible.. But you can push the application permissions screen so that user can set them allow.. Take look in to the class ApplicationPermissions ..

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 41
Registered: ‎04-10-2009
My Device: Not Specified

Re: controlled Access Exception while caputuring sound

thanks