From 06c626a44fa8b456d3ff2a0a177a0ee8252a45eb Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Thu, 22 Oct 2009 14:25:45 -0700 Subject: [PATCH] Prototype of the File API implemented --- assets/www/index.html | 13 +++++++------ src/com/phonegap/demo/DroidGap.java | 1 - src/com/phonegap/demo/FileUtils.java | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/assets/www/index.html b/assets/www/index.html index 6630b865..cf787db1 100644 --- a/assets/www/index.html +++ b/assets/www/index.html @@ -87,11 +87,12 @@ alert(fail); } - function foo() - { - ContactHook.findContacts(); - } - + // This is just to do this. + function readFile() + { + navigator.file.read('/sdcard/phonegap.txt', fail , fail); + } + function init(){ document.addEventListener("touchmove", preventBehavior, false); setTimeout(deviceInfo, 1); @@ -118,7 +119,7 @@ Beep Vibrate Get a Picture - Fire Contact Code + Read from file
diff --git a/src/com/phonegap/demo/DroidGap.java b/src/com/phonegap/demo/DroidGap.java index 1a491730..f2cfbdf1 100644 --- a/src/com/phonegap/demo/DroidGap.java +++ b/src/com/phonegap/demo/DroidGap.java @@ -95,7 +95,6 @@ public class DroidGap extends Activity { private void bindBrowser(WebView appView) { - gap = new PhoneGap(this, appView); geo = new GeoBroker(appView, this); accel = new AccelListener(this, appView); diff --git a/src/com/phonegap/demo/FileUtils.java b/src/com/phonegap/demo/FileUtils.java index 270e9bf2..b78c76a2 100644 --- a/src/com/phonegap/demo/FileUtils.java +++ b/src/com/phonegap/demo/FileUtils.java @@ -81,6 +81,7 @@ public class FileUtils { { data += in.readLine(); } + } catch (FileNotFoundException e) { data = "FAIL: File not found"; } catch (IOException e) {