I am a Blackberry Developer i create a blackberry camera application. But i take picture when i click is it possible to take picture without any user interaction.It's Necessary for my Application. please suggest me and send me the code and i am going through this process.
public void doTakePicture(){
try
{
System.out.println("Inside doTakePicture");
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,new CameraArguments());
player = javax.microedition.media.Manager.createPlayer("capture://video");
player.realize();
player.start();
videoControl = (VideoControl) player.getControl("VideoControl");
if(videoControl!=null)
{
Field videoField = (Field) videoControl.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
videoControl.setDisplayFullScreen(true);
videoControl.setVisible(true);
System.out.println("videoControl=="+videoControl);
if(videoField != null)
{
add(videoField);
}
}
}
catch(Exception ex)
{
System.out.println(ex);
}
}
public boolean invokeAction(int action) { System.out.println("Action=="+action); boolean handled = super.invokeAction(action);
System.out.println("handled=="+handled);
System.out.println("Inside Invoke Camera");
if(handled==false)
{
System.out.println("Inside First If Blog");
if(action == ACTION_INVOKE)
{
System.out.println("Inside Second If Blog");
try
{
System.out.println("If Blog of invoke Action");
System.out.println("videoControl11=="+videoControl);
byte[] snapshot = videoControl.getSnapshot(null);
System.out.println("snapshot=="+snapshot);
}
catch(Exception e)
{
Dialog.alert(e.toString());
}
}
}
return handled;
}
using this code I want to try take picture automatic when camera is invoke but not taking picture automatic and i am getting a null value here byte[] snapshot = videoControl.getSnapshot(null);
please help me where i am making mistake.
Thanks in Advance