You must push the camera scene from your current scene. This will open the standard camera screen. When the user takes a picture or presses the cancel button it will return control to your scene, and you will get a call to the activate method.
//launch the camera view
this.controller.stageController.pushScene(
{
appId : 'com.palm.app.camera',
name: 'capture'
},
{
sublaunch : true,
filename : '/media/internal/testpicture.jpg'
}
);
//the activate function on your scene
activate: function(event) {
console.log("got an activate " + event);
if(event != undefined) {
//the camera returned
console.log("json = " + Object.toJSON(event));
console.log("filename of the photo = " + event.filename);
}
}