mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
start adding stuff and alerts to debug GPS, PLaySOund, and Accelerometer and PhoneGap.java corrected to match my Gap.js changes
This commit is contained in:
@@ -196,6 +196,7 @@ var Device = {
|
||||
if (Device.available || Device.whatPlatform == "Android") {
|
||||
try {
|
||||
document.location = "javascript:" + "window.DroidGap." + command + "()";
|
||||
alert('document.location=' + document.location);
|
||||
} catch(e) {
|
||||
console.log("Command '" + command + "' has not been executed, because of exception: " + e);
|
||||
alert("Error executing command '" + command + "'.")
|
||||
@@ -213,11 +214,14 @@ var Device = {
|
||||
|
||||
init: function() {
|
||||
Device.exec("getloc");
|
||||
alert('initialized Location function and getloc was called');
|
||||
},
|
||||
|
||||
set: function(lat, lon) {
|
||||
Device.Location.lat = lat;
|
||||
Device.Location.lon = lon;
|
||||
alert('Device.Location let is' + lat);
|
||||
alert('Device.Location lon is' + lon);
|
||||
if(Device.Location.callback != null) {
|
||||
Device.Location.callback(lat, lon)
|
||||
Device.Location.callback = null;
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
in the format of src=http://hostname:port/iBug.js
|
||||
if you are not using to debug comment out
|
||||
-->
|
||||
<script type="application/x-javascript" src="http://%(hostName)s:%(port)s/ibug.js"></script>
|
||||
<!-- <script type="application/x-javascript" src="http://192.168.1.20:1840/ibug.js"></script> -->
|
||||
|
||||
<script>
|
||||
|
||||
@@ -62,7 +62,7 @@ updateAccel = function(){
|
||||
addLoadEvent(initGap);
|
||||
|
||||
</script>
|
||||
</head><body orient="landscape">
|
||||
</head><body orient="landscape">
|
||||
<div class="toolbar">
|
||||
<h1 id="pageTitle">Main</h1>
|
||||
<a style="display: none;" id="backButton" class="button" href="#"></a>
|
||||
|
||||
Reference in New Issue
Block a user