me trataron writing/reading
un archivo en phonegap+android
, aquí está la configuración:escritura y el archivo de lectura en PhoneGap
$(document).ready(function() {
document.addEventListener("deviceready", deviceready, true);
$(document).bind("deviceready", function(){
//writeFile();
//readFile();
});
});
function deviceready() {
writeFile();
readFile();
}
// This is just to do this.
function readFile() {
var d = navigator.file.read('/sdcard/foo.xml', success(), fail());
console.warn(d);
}
function writeFile() {
navigator.file.write('/sdcard/foo.xml', "This is a test of writing to a file",
success(), fail());
}
Pero en el emulador para Android 2.2, obtuve el siguiente mensaje de error:
08-06 14:21:29.428: INFO/Web Console(936): Error in success callback: Network Status1 = TypeError: Result of expression 'navigator.file' [undefined] is not an object. at file:///android_asset/www/phonegap.0.9.6.js:649
¿Qué podría faltar y qué podría intentarse?
podría ser el que está utilizando el éxito() en lugar de éxito en su llamada de vuelta mismo ocurre con Despiste() debe fallar –