var deviceInfo = function() { document.getElementById("platform").innerHTML = device.platform; document.getElementById("version").innerHTML = device.version; document.getElementById("uuid").innerHTML = device.uuid; document.getElementById("name").innerHTML = device.name; document.getElementById("width").innerHTML = screen.width; document.getElementById("height").innerHTML = screen.height; document.getElementById("colorDepth").innerHTML = screen.colorDepth; }; var getContacts = function () { function onSuccess(contacts) { for (var i = 0; i < navigator.contacts.length; i++) { for (var j = 0; j < contacts[i].addresses.length; j++) { alert("Name: " + contacts[i].name + "\n" + "Phone: " + contacts[i].phoneNumbers[j].pref + "\n" ); } } }; function onError(contactError) { alert('onError!'); }; // find all contacts that have phone number var options = new ContactFindOptions(); options.hasPhoneNumber = true; var fields = [navigator.contacts.fieldType.name]; navigator.contacts.find(fields, onSuccess, onError, options); }; function init() { // the next line makes it impossible to see Contacts on the HTC Evo since it // doesn't have a scroll button // document.addEventListener("touchmove", preventBehavior, false); document.addEventListener("deviceready", deviceInfo, true); }