cordova calls causing app to reboot

5 posts, 0 answers
  1. Roger
    Roger avatar
    183 posts
    Member since:
    Sep 2007

    Posted 17 Jan 2014 Link to this post

    Hi,
    I'm using Cordova 3.0.
    What I am trying to do is take a picture, move it to a different directory and then transfer the image to the server.
    I can't get past the taking a picture bit

    navigator.camera.getPicture(  function(image){
                                                      console.log('image: ' + image);
                                                       window.resolveLocalFileSystemURI(image,function(fileEntry){
                                                                          consol.log('fileEntry path: ' + fileEntry.fullPath);
                                                                  },
                                                                  function(error){    
                                                                             console.log('resolve error');           
                                                                    }
                                                         );


                                           },
                                         function(error){
                                                  console.log('Error');
                                        }, 
                        {quality : 75,
                          destinationType : Camera.DestinationType.DATA_URI,
                          sourceType : Camera.PictureSourceType.CAMERA,
                          allowEdit : true,
                          encodingType: Camera.EncodingType.JPEG});


    As soon as I select save on the picture the app reboots. It behaves intermittently in that I think I have it fixed & then it blows up again & reboots the app....I get no messages anywhere to say what is going on ?????
    Using Samsung Galaxy 3
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Jan 2014 Link to this post

    Hi Roger,

    I would suggest testing on more than one device. If the problem persists across all devices, try decreasing the quality to at least 50 and try again. If the problem occurs on a single device only, you can use remote debugging tools like jsHybugger and Weinre to try to pinpoint what is going wrong. You can also setup Fiddler to intercept your device's traffic which would give you a clue what's going on if the problem is failing/wrong requests/responses.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. Roger
    Roger avatar
    183 posts
    Member since:
    Sep 2007

    Posted 17 Jan 2014 Link to this post

    Hi Steve,
    great advice...used an iPhone 5 and managed to get the image and move it to the [app hash]/documents directory with a new name.....still blows up on Android.
    Have decreased the image size but no difference. seems to happen sporadically...I get to a certain stage in the process and then it dies.
    Used jsHybugger but as soon as I press save on the image it breaks the websocket connection.

    I even removed and re-deployed the app to the Galaxy 3 but same thing...no joy 

    Attached is the code I'm using...why would it work on apple and not Android???
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 22 Jan 2014 Link to this post

    Hello Roger,

    We do not see anything wrong with your code and the fact it works sporadically is even more baffling. I would suggest posting this issue to the Cordova google group or issue tracker for a second opinion, why would this work intermittently.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  5. Roger
    Roger avatar
    183 posts
    Member since:
    Sep 2007

    Posted 22 Jan 2014 Link to this post

    Hi Steve,
    put a post on the Senhcha site as well as created a new issue in jira (https://issues.apache.org/jira/browse/CB)

    number: CB5846

    I agree..sounds weird & am hoping other people will try the code to see if I have made a mistake.
    It's pure java/cordova so no frameworks are involved....could there be a problem with Icenium LiveSync  on Android?
Back to Top