You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Roger Burke (JIRA)" <ji...@apache.org> on 2014/01/22 08:31:19 UTC
[jira] [Created] (CB-5846) accessing file system reboots app in
Android but not iPhone
Roger Burke created CB-5846:
-------------------------------
Summary: 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, iOS
Affects Versions: 3.2.0, 3.0.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)