Welcome!

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

Native Development

Reply
New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

ContactService can not get full contacts from device

[ Edited ]

Hi all,

 

Please help me solve this problem, I used ContactService and it's working fine but it can not get all contacts from my device even I don't set any criteria like below, it just got a part of contacts.

 

QList<Contact> contacts;

    if (m_filter.isEmpty()) {
        ContactListFilters filter;
        contacts = m_contactService->contacts(filter);
    } else {
        ContactSearchFilters filter;
        filter.setSearchValue(m_filter);
        contacts = m_contactService->searchContacts(filter);
    }

 

 

Regular Contributor
Posts: 205
Registered: ‎06-11-2013
My Device: Blackbery z10
My Carrier: RIM

Re: ContactService can not get full contacts from device

Have you tried it on emulator. 

New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

Re: ContactService can not get full contacts from device

I tested on real device (Z10). Please help me with this one

Regular Contributor
Posts: 205
Registered: ‎06-11-2013
My Device: Blackbery z10
My Carrier: RIM

Re: ContactService can not get full contacts from device

Is it dev apha?

New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

Re: ContactService can not get full contacts from device

I'm using blackberry z10. This is the device "http://us.blackberry.com/smartphones/blackberry-z10.html". I tried another app and it get fullly my contacts.

Regular Contributor
Posts: 205
Registered: ‎06-11-2013
My Device: Blackbery z10
My Carrier: RIM

Re: ContactService can not get full contacts from device

Can you provide the full source code, with all the parameters 

New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

Re: ContactService can not get full contacts from device

I'm using addressbook source of the Cascades Sample

 

https://github.com/blackberry/Cascades-Samples/tree/master/addressbook

Developer
Posts: 362
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: ContactService can not get full contacts from device

[ Edited ]

It looks like there is a default filter ot 20 records.

 

I changed this to

 

    if (m_filter.isEmpty()) {
        // No filter has been specified, so just list all contacts
        ContactListFilters filter;
        filter.setLimit(50);
        contacts = m_contactService->contacts(filter);
    } else {
        // Use the entered filter string as search value
        ContactSearchFilters filter;
        filter.setSearchValue(m_filter);
        contacts = m_contactService->searchContacts(filter);
    }

 And it displayed more records.

New Developer
Posts: 10
Registered: ‎08-08-2013
My Device: Z10
My Carrier: 0908551261

Re: ContactService can not get full contacts from device

Thanks very much, it solved the problem.

Highlighted
Developer
Posts: 362
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: ContactService can not get full contacts from device

You are welcome, if you use filter.setLimit(0); , then it will get all records.