Note that there are some explanatory texts on larger screens.

plurals
  1. POCordova / Samsung Galaxy SIII - Camera Crashes app
    text
    copied!<h1>Fixed: "Do not keep activities" is default on SG3</h1> <p>Samsung Galaxy S3 ships with "Do not keep Activities" on by default (test models in two locations were both having this fault out the box)</p> <p>Of course this means that as soon as any other activity is started, including from within your Cordova/PhoneGap app, your app's main activity will be destroyed. Any callback events will obviously never fire.</p> <p>Switching the option off fixes the problem.</p> <p>Check developer options regardless of brand/model, for example Asus Nexus 7 tablets do not have this default.</p> <hr> <p>I've setup a basic test app. Which has a button and an img tag + the unmodified Cordova <code>index.js</code> </p> <p>Button onclick is calling <code>capturePhoto()</code>:</p> <pre><code>function onPhotoURISuccess(imageURI) { console.log(imageURI); var largeImage = document.getElementById('largeImage'); largeImage.style.display = 'block'; largeImage.src = imageURI; } function capturePhoto() { navigator.camera.getPicture( onPhotoURISuccess, onFail, { quality: 20, allowEdit: true, destinationType: Camera.DestinationType.FILE_URI }); } function onFail(message) { alert('Failed because: ' + message); } </code></pre> <p>When I run the app on the simulator and also on a Asus Nexus 7 Tablet, the Camera opens as expected, allows a photo to be taken and confirmed, and then returns with the FILE_URI and sets the image <code>src</code> attribute.</p> <p>However on a Samsung Galaxy SIII, (we are testing with two in different locations) the Camera opens, allows a capture, and after confirmation, attempts to resume the test app and dies.</p> <p>Does anyone know of this problem, and is there a way to fix it?</p> <p>FYI, I've added an extra setting to the <code>AndroidManifest.xml</code> activity node : <code>android:screenOrientation="nosensor"</code> - although this doesn't solve the issue (clutching at straws here.)</p> <h3>Other info:</h3> <ul> <li>Phone is running Android 4.1.2</li> <li>Targetting sdk 16</li> <li>Cordova v 2.4.0rc1</li> </ul> <p>Tested versions of phonegap - 1.8 - 2.4rc (all crash or fail to return image.)</p> <p>Relevant portion of the stacktrace is here: <a href="http://pastie.org/5974920" rel="noreferrer">http://pastie.org/5974920</a></p> <h1>Update</h1> <ul> <li>regarding Simon MacDonald's suggestion.</li> </ul> <p>Tested with <code>quality : 100</code></p> <p>Same results as before. </p> <ul> <li>1.9-2.1 bomb (no message)</li> <li>2.2-2.3 get back to the app, but no image.</li> <li>2.4 - sorry the app has stopped - "managed" crash</li> </ul> <p>None working.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload