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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
naveen4nkp
Posts: 41
Registered: ‎04-10-2009
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, 

 

Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008

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
Please use plain text.
Developer
naveen4nkp
Posts: 41
Registered: ‎04-10-2009

Re: controlled Access Exception while caputuring sound

Hi , 

 

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

 

thanks ,

  

 

Please use plain text.
Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008

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
Please use plain text.
Developer
naveen4nkp
Posts: 41
Registered: ‎04-10-2009

Re: controlled Access Exception while caputuring sound

thanks
Please use plain text.