Hi All,
Using Android, I run the following code to get all the contacts on the
phone. On a device with 1k contacts, it takes about 3 minutes to from
the time of the request until the success callback runs. From the
logcat it appears that SQL Lite is thrashing about. If I filter for
just records with 'Bob' (8) the app is responsive. I read about some
limit of 1mb for a SQL result though I've not dove into the details.
Is there a workaround? I need to populate list with all contacts. Just
name and few details for each. Thanks!
Note: I'm watching the console logging with Weinre at
debug.phonegap.com.
if (havePhoneGap) {
// this.contactStore.load();
console.log('Test contacts find');
navigator.service.contacts.find(
//Fields
//['id', 'name', 'emails', 'phoneNumbers',
'addresses'],
['name'],
//Success function
function(deviceContacts) {
console.log("Found contacts success ");
//loop over deviceContacts and create Contact
model instances
var contacts = [];
console.log("Found contacts " +
deviceContacts.length);
for (var i = 0; i < deviceContacts.length; i++) {
console.log(deviceContacts[i].name.givenName);
}
},
//Error function
function (e) {
console.log('Error fetching contacts');
},
//Options
{multiple: true, filter: ''}
);
}