Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 69
Registered: ‎09-05-2012
My Device: Z10 Red, PlayBook, DevAlpha C

Problem with huge execution time of "getContact"


Execution time of "getContact" statement in my app is 3 sec !!!

I don't know why this take so long.

May be someone can review my code and tell me what's wrong?


This is my code:

function onCancel() {
		console.log("User pressed cancel in contact picker.");

	function onInvoke(error) {
		if (error) {
			console.log("Error invoking contact picker: " + error.code);
		else {
			console.log("Contact picker invoked!");
	function onContactSelected(data) {
		console.log("Id of selected contact: " + data.contactId);
		var contact = blackberry.pim.contacts.getContact(data.contactId);
		console.log("Organization: "+ contact.organizations[0].name);
		console.log("PIN: "+ contact.ims[0].value);
		console.log("Phone: "+ contact.phoneNumbers[0].value);
		console.log("EMail: "+ contact.emails[0].value);
	function invokeContactPickerSingle() {
			mode: blackberry.pim.contacts.ContactPickerOptions.MODE_SINGLE,
			fields: ["phoneNumbers"]
		}, onContactSelected, onCancel, onInvoke);

 And execution details:




Posts: 69
Registered: ‎09-05-2012
My Device: Z10 Red, PlayBook, DevAlpha C

Re: Problem with huge execution time of "getContact"

Any reply since Feb 20 ?

Maybe this is normal, I mean, 3 sec for script evaluation.

But I think this is very huge amount of time.

Recently tested on my Z10LE