This is a migrated thread and some comments may be shown as answers.

cordova calls causing app to reboot

5 Answers 63 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roger
Top achievements
Rank 1
Roger asked on 17 Jan 2014, 08:48 AM
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

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 Jan 2014, 12:42 PM
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.
0
Roger
Top achievements
Rank 1
answered on 18 Jan 2014, 02:56 AM
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???
0
Steve
Telerik team
answered on 22 Jan 2014, 12:36 PM
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.
0
Roger
Top achievements
Rank 1
answered on 22 Jan 2014, 10:50 PM
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?
0
Steve
Telerik team
answered on 23 Jan 2014, 08:17 AM
Hi Roger,

Icenium LiveSync is basically a way to reflect changes you make to files in your app almost instantly, it shouldn't have anything to do with this problem. You can easily rule that out from your suspicion by turning off LiveSync and only build the .apk via Icenium. Then download it on your machine and install it manually.

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.
Tags
Apache Cordova
Asked by
Roger
Top achievements
Rank 1
Answers by
Steve
Telerik team
Roger
Top achievements
Rank 1
Share this question
or