1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    2
    Vote Rating
    0
    araouf is on a distinguished road

      0  

    Default Native Camera : User has canceled operation

    Native Camera : User has canceled operation


    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

    Code:
    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
            });
        }
                            
                
            });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,011
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I have not tried canceling myself, will have to check that out.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    2
    Vote Rating
    0
    araouf is on a distinguished road

      0  

    Default


    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


  4. #4
    Sencha User
    Join Date
    Dec 2011
    Location
    México
    Posts
    11
    Vote Rating
    0
    oresistemas is on a distinguished road

      0  

    Default I have the same error...

    I have the same error...


    I have the same error... Any solution?
    Is this a bug?
    I use Sencha Touch 2.2

  5. #5
    Sencha User
    Join Date
    Jul 2013
    Posts
    1
    Vote Rating
    0
    dewald is on a distinguished road

      0  

    Default Android Permissions

    Android Permissions


    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.