我想在Android设备(三星Galaxy S II)上第一次运行PhoneGap; 但是,它似乎没有用.
这是我到目前为止尝试的代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi"
/>
<title>Hello World</title>
<script type="text/javascript" src="cordova-2.2.0.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
var options = new ContactFindOptions();
options.filter = "";
options.multiple = true;
var filter = ["displayName"];
navigator.contacts.find(filter, onSuccess, onError, options);
}
function onSuccess(contacts) {
for(var i = 0; i < contacts.length; ++i) {
alert(contacts[i].displayName);
}
alert("OK then");
console.log("OK");
}
function onError(contactError) …Run Code Online (Sandbox Code Playgroud)