Help get this topic noticed by sharing it on Twitter Twitter, Facebook Facebook, or email.
Cher Rowland
sad I’m frustrated

Android ReferenceError Can't Find Variable ContactFindOptions

I have developed a phonegap application that I have run and tested successfully on the iOS simulator. I am attempting to now verify the functionality within the android environment.

I am using eclipse so I created a new android project from existing source using the 'example' code from within phonegap/lib/android folder for cordova-1.7.0. I then copy over my code that is running correctly on iOS (except i leave the cordova.js from the example as-is and make sure this is the same js file linked from my index.html).

I've verified the manifest requests appropriate permissions:

I've attempted this both within an emulator and separately on a device (all be it an older motorola backflip, running version 2.1).

Here is the sample code that fails on Android:

...
function getAllContacts() {
// find all contacts with 'Bob' in any name field
var options = new ContactFindOptions();
options.filter='';
options.multiple = true;
var fields = ["id", "displayName", "givenName", "lastName"];
navigator.contacts.find(fields, onFindAllContactsSuccess, onFindAllContactsError, options);
}
1 person has
this problem
+1
Reply