PDA

View Full Version : Native Camera : User has canceled operation



araouf
20 Nov 2012, 10:59 PM
Hello,

Im testing out the camera functionality using Ext-device-Camera running on an Android device.

In the app you click a button which launches the camera. Upon success the image should be displayed, however the image is not displayed. The success function is being called though. So I send out the URL to an alert box and the message is "User has cancelled operation".

I am not cancelling the operation. After taking the picture I click on the checkmark which returns me to the app. Any idea what could be causing this? The app is packaged using sencha cmd 3.0xx

Here is the code that launches the camera


onMybuttonTap: function(button, e, options) { Ext.device.Camera.capture({
source: 'camera',
destination: 'file',


success: function(url) {
//show the newly captured image in a full screen Ext.Img component:
Ext.Msg.alert('Success', url);
Ext.create('Ext.Img', {
src: url,
fullscreen: true
});
}


});

mitchellsimoens
23 Nov 2012, 7:06 AM
I have not tried canceling myself, will have to check that out.

araouf
25 Nov 2012, 2:18 AM
Hi Mitchell,

Thank you for the reply. I would just like to clarify that I am not cancelling the operation. The actual sequence is as follows:

1 - Click button to launch the camera
2 - Take picture
3 - Click the check mark to complete the operation (on Android the checkmark is the Ok/Done button in this context).
4 - Returns to the app
5 - Display alert box containing the URL of the image returned by the camera function (for debugging).
6 - The URL for the image is "User has canceled operation"
7 - Obviously the image is not displayed since there is no proper URL returned.

I am using the basic camera code from the documentation. Let me know if you need any further information.


Thank you

oresistemas
10 Jun 2013, 1:58 PM
I have the same error... Any solution?
Is this a bug?
I use Sencha Touch 2.2

dewald
10 Jul 2013, 4:15 AM
I finally found that, for Android, you need to add the "WRITE_EXTERNAL_STORAGE" permission to the permissions list in your app's packager.json file.