mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Harmonizing Contacts
This commit is contained in:
parent
7aebe97330
commit
103cdd5458
@ -102,6 +102,16 @@
|
|||||||
navigator.file.write('foo.txt', "This is a test of writing to a file", fail, fail);
|
navigator.file.write('foo.txt', "This is a test of writing to a file", fail, fail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_contacts()
|
||||||
|
{
|
||||||
|
navigator.ContactManager.getAllContacts(count_contacts, fail, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function count_contacts(contacts)
|
||||||
|
{
|
||||||
|
alert(contacts.length);
|
||||||
|
}
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
document.addEventListener("touchmove", preventBehavior, false);
|
document.addEventListener("touchmove", preventBehavior, false);
|
||||||
document.addEventListener("deviceReady", deviceInfo, true);
|
document.addEventListener("deviceReady", deviceInfo, true);
|
||||||
@ -130,6 +140,7 @@
|
|||||||
<a href="#" class="btn large" onclick="beep();">Beep</a>
|
<a href="#" class="btn large" onclick="beep();">Beep</a>
|
||||||
<a href="#" class="btn large" onclick="vibrate();">Vibrate</a>
|
<a href="#" class="btn large" onclick="vibrate();">Vibrate</a>
|
||||||
<a href="#" class="btn large" onclick="show_pic();">Get a Picture</a>
|
<a href="#" class="btn large" onclick="show_pic();">Get a Picture</a>
|
||||||
|
<a href="#" class="btn large" onclick="get_contacts();">Get phone's contacts</a>
|
||||||
<div id="viewport" class="viewport" style="display: none;">
|
<div id="viewport" class="viewport" style="display: none;">
|
||||||
<img style="width:60px;height:60px" id="test_img" src="" />
|
<img style="width:60px;height:60px" id="test_img" src="" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -160,9 +160,9 @@ public class ContactManager {
|
|||||||
|
|
||||||
// Code for backwards compatibility with the OLD Contacts API
|
// Code for backwards compatibility with the OLD Contacts API
|
||||||
if (all)
|
if (all)
|
||||||
mView.loadUrl("javascript:navigator.AddressBook.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
mView.loadUrl("javascript:navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
||||||
else
|
else
|
||||||
mView.loadUrl("javascript:navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
mView.loadUrl("javascript:navigator.AddressBook.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"')");
|
||||||
|
|
||||||
} while (cur.moveToNext());
|
} while (cur.moveToNext());
|
||||||
if (all)
|
if (all)
|
||||||
|
Loading…
Reference in New Issue
Block a user