cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-5846) accessing file system reboots app in Android but not iPhone
Date Fri, 24 Jan 2014 02:29:37 GMT

     [ https://issues.apache.org/jira/browse/CB-5846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shazron Abdullah updated CB-5846:
---------------------------------

    Component/s:     (was: iOS)

> accessing file system reboots app in Android but not iPhone
> -----------------------------------------------------------
>
>                 Key: CB-5846
>                 URL: https://issues.apache.org/jira/browse/CB-5846
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.0.0, 3.2.0
>         Environment: Telerik Graphite with Icenium Livesync on Galaxy S3 and Icenium
Ion on iPhone5
>            Reporter: Roger Burke
>
> Created a function to take a picture and then move the picture to the root directory
while giving it a new name.
> On Android, when you select save the app reboots. I use jsHybugger for debugging on the
phone and the connection just breaks so can get no details.
> On iPhone the app completes as designed.
> Sample code as below can be attached to a buttontap:
> navigator.camera.getPicture( 
>                  function(image){
>                       console.log('image success: ' + image); 
>                           window.resolveLocalFileSystemURI(image,
>                                  function(imageFile){
>                                      console.log('Resolve success: ');
>                                          window.requestFileSystem(LocalFileSystem.PERSISTENT,
0, 
>                                                function(fileSystem){
>                                                     console.log("Request success");
>                                                     console.log("fileSystem: " + fileSystem.root.fullPath);
>                                                    var fileID = me.generateUUID();
>                                                     imageFile.moveTo(fileSystem.root,
fileID + 'jpg',
>                                                        function(newFile){
>                                                          console.log('moved it: ' + newFile.fullPath);
 
>                                                        },
>                                                        function(error){
>                                                            console.log("Move Error "
+ error); 
>                                                        }
>                                                    );
>                                                },
>                                                function(error){
>                                                    console.log("Request Error"); 
>                                                }
>                                          );
>                          
>                                  },
>                                   function(error){
>                                          console.log('Resolve Error');   
>                                   }
>                            );
>                       },
>                       function(error){
>                                console.log('camera error(' + error + ')');
>                         },
>                         {destinationType : Camera.DestinationType.File_URL,    
>                               sourceType : Camera.PictureSourceType.CAMERA,
>                               encodingType: Camera.EncodingType.JPEG,
>                                quality : 50}                    
>                     );
> //generateUUID is used to creatd individual uid for file
> function generateUUID() {
>         var d = new Date().getTime();
>         var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c)
{
>             var r = (d + Math.random()*16)%16 | 0;
>             d = Math.floor(d/16);
>             return (c=='x' ? r : (r&0x7|0x8)).toString(16);
>         });
>         return uuid;
>     }
>                             



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message