mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Prototype of the File API implemented
This commit is contained in:
parent
f87bf2d12a
commit
06c626a44f
@ -87,10 +87,11 @@
|
|||||||
alert(fail);
|
alert(fail);
|
||||||
}
|
}
|
||||||
|
|
||||||
function foo()
|
// This is just to do this.
|
||||||
{
|
function readFile()
|
||||||
ContactHook.findContacts();
|
{
|
||||||
}
|
navigator.file.read('/sdcard/phonegap.txt', fail , fail);
|
||||||
|
}
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
document.addEventListener("touchmove", preventBehavior, false);
|
document.addEventListener("touchmove", preventBehavior, false);
|
||||||
@ -118,7 +119,7 @@
|
|||||||
<a href="#" class="btn" onclick="beep();">Beep</a>
|
<a href="#" class="btn" onclick="beep();">Beep</a>
|
||||||
<a href="#" class="btn" onclick="vibrate();">Vibrate</a>
|
<a href="#" class="btn" onclick="vibrate();">Vibrate</a>
|
||||||
<a href="#" class="btn" onclick="show_pic();">Get a Picture</a>
|
<a href="#" class="btn" onclick="show_pic();">Get a Picture</a>
|
||||||
<a href="#" class="btn" onclick="foo();">Fire Contact Code</a>
|
<a href="#" class="btn" onclick="readFile();">Read from file</a>
|
||||||
<div id="viewport" class="viewport">
|
<div id="viewport" class="viewport">
|
||||||
<img style="width:60px;height:60px" id="test_img" src="" />
|
<img style="width:60px;height:60px" id="test_img" src="" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -95,7 +95,6 @@ public class DroidGap extends Activity {
|
|||||||
|
|
||||||
private void bindBrowser(WebView appView)
|
private void bindBrowser(WebView appView)
|
||||||
{
|
{
|
||||||
|
|
||||||
gap = new PhoneGap(this, appView);
|
gap = new PhoneGap(this, appView);
|
||||||
geo = new GeoBroker(appView, this);
|
geo = new GeoBroker(appView, this);
|
||||||
accel = new AccelListener(this, appView);
|
accel = new AccelListener(this, appView);
|
||||||
|
@ -81,6 +81,7 @@ public class FileUtils {
|
|||||||
{
|
{
|
||||||
data += in.readLine();
|
data += in.readLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
data = "FAIL: File not found";
|
data = "FAIL: File not found";
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user