You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org> on 2012/02/02 21:24:55 UTC
[jira] [Commented] (CB-205) Droid 3 Camera Causes App Restart
[ https://issues.apache.org/jira/browse/CB-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199183#comment-13199183 ]
Alan Neveu commented on CB-205:
-------------------------------
I just experienced this exact same issue on a Droid 3. This thread describes the behavior exactly. I searched around the web and found these two posts that seem like they will help PhoneGap work around this issue:
http://community.developer.motorola.com/t5/Android-App-Development-for/Moto-Backflip-Camera-crashes-while-calling-from-intent/td-p/5254
and this one:
http://andrea.levinge.me/?p=132
Looking forward to some resolution on this, definitely not PhoneGap's fault but it would be fantastic if we could resolve this at the PG layer. Thanks!
> Droid 3 Camera Causes App Restart
> ---------------------------------
>
> Key: CB-205
> URL: https://issues.apache.org/jira/browse/CB-205
> Project: Apache Callback
> Issue Type: Bug
> Components: Android
> Affects Versions: 1.3.0
> Environment: Phonegap Sample App
> Droid 3 with current updates (Android 2.3.4)
> Native (for droid 3) camera app.
> Reporter: John Reeves
> Labels: camera, motoblur, restart
> Fix For: 1.6.0
>
>
> # In the sample app, click the button to take a picture.
> # The camera app launches, take a picture, and tap done.
> # The sample app reappears but there is no indication that the picture was taken.
> I made a simple app to test this, which should simply alert the FILE_URI result, or alert something on error. Neither callbacks are hit, instead the app restarts. If you view the logcat, it shows a console.log() right before launching the camera, and the next log message after taking the picture shows a new PID and other logs related to the app starting.
> This happens in any app I have tried this with, even the simplest "take a picture and alert the path" app. It also happens with alternative camera apps. I've tried a couple of 3rd party camera apps with the same outcome.
> This might be related - They describe the exact behavior I see, but I tried using their modified phonegap.jar with no luck.
> https://groups.google.com/group/phonegap/browse_thread/thread/185c2fd8eb6270ac/db973ebc78d6b4b6?lnk=gst&q=%22droid+3%22#db973ebc78d6b4b6
> {code:title=index.html}
> <!DOCTYPE html>
> <html>
> <head>
> <title>Capture Image</title>
> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
> <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
> <script type="text/javascript" charset="utf-8">
> var defaultPictureOptions = {
> quality : 50,
> destinationType: Camera.DestinationType.FILE_URI,
> sourceType: Camera.PictureSourceType.CAMERA
> /* ,
> targetWidth: 100,
> targetHeight: 100
> */
> };
> var phonegapPic = function(onSuccess, onFail, photoType) {
> if (!navigator) { console.log('no navigator obj'); return false; }
> if (!navigator.camera) { console.log('no navigator.camera obj'); return false; }
> if (!navigator.camera.getPicture) { console.log('no navigator.camera.getPicture'); return false; }
> photoType = photoType || "camera";
> console.log('taking picture...');
> var opts = $.extend({}, defaultPictureOptions, {
> sourceType: (photoType === "camera") ? Camera.PictureSourceType.CAMERA : Camera.PictureSourceType.PHOTOLIBRARY
> });
> navigator.camera.getPicture(onSuccess, onFail, opts);
> return true;
> };
>
>
> function captureImage()
> {
> phonegapPic( function( imgURI ){ alert( 'got picture: ' + imgURI ); },
> function(){ alert( 'error!' )} );
> }
> </script>
> </head>
> <body>
> <button onclick="captureImage();">Capture Image</button> <br>
> </body>
> </html>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira