forked from github/cordova-android
Prototype of the File API implemented
This commit is contained in:
parent
cccce01415
commit
e36e4bc0a3
@ -87,6 +87,12 @@
|
|||||||
alert(fail);
|
alert(fail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is just to do this.
|
||||||
|
function readFile()
|
||||||
|
{
|
||||||
|
navigator.file.read('/sdcard/phonegap.txt', fail , fail);
|
||||||
|
}
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
document.addEventListener("touchmove", preventBehavior, false);
|
document.addEventListener("touchmove", preventBehavior, false);
|
||||||
setTimeout(deviceInfo, 1);
|
setTimeout(deviceInfo, 1);
|
||||||
@ -112,7 +118,8 @@
|
|||||||
<a href="tel://411" class="btn large">Call 411</a>
|
<a href="tel://411" class="btn large">Call 411</a>
|
||||||
<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 large" onclick="show_pic();">Get a Picture</a>
|
<a href="#" class="btn" onclick="show_pic();">Get a Picture</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>
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
# "build.properties", and override values to adapt the script to your
|
# "build.properties", and override values to adapt the script to your
|
||||||
# project structure.
|
# project structure.
|
||||||
|
|
||||||
# Project target.
|
|
||||||
target=Google Inc.:Google APIs:3
|
|
||||||
# apk configurations. This property allows creation of APK files with limited
|
# apk configurations. This property allows creation of APK files with limited
|
||||||
# resources. For example, if your application contains many locales and
|
# resources. For example, if your application contains many locales and
|
||||||
# you wish to release multiple smaller apks instead of a large one, you can
|
# you wish to release multiple smaller apks instead of a large one, you can
|
||||||
@ -20,3 +18,5 @@ target=Google Inc.:Google APIs:3
|
|||||||
# apk-config-european=en,fr,it,de,es
|
# apk-config-european=en,fr,it,de,es
|
||||||
# apk-config-northamerica=en,es
|
# apk-config-northamerica=en,es
|
||||||
apk-configurations=
|
apk-configurations=
|
||||||
|
# Project target.
|
||||||
|
target=Google Inc.:Google APIs:4
|
||||||
|
@ -94,7 +94,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