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
Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10
My Carrier: Aircel

Size of my all contacts in bytes

Hi All,

 

I am able to calculate the number of my contact present in my device.

Now I want to calculate the size of my all contacts in the form of Bytes.

 

So please provide any suggestion for this.

 

Thanks in Advance.

Developer
Posts: 16,612
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Size of my all contacts in bytes

this information is not available as far as i know
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Size of my all contacts in bytes

What's the purpose of this, the only thing that comes to mind is you want to transport it.

In which case it depends on which format you intend to transport (e.g. xml, sql, http, etc. etc.).

 

My suggestion is to just write them all out to a temporary file and then read the filesize.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Size of my all contacts in bytes

Simon and BBSJdev are correct, there is no way to just calculate the number of bytes the data in the contact API represents.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10
My Carrier: Aircel

Re: Size of my all contacts in bytes

Thank a lot Simon, BBSJdev and PBernhardt for your suggestion.

 

And I will try to apply your suggestion BBSJdev.

 

Thanks Guys... :smileyhappy:

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

Re: Size of my all contacts in bytes

Hi,

 

  Can you please share how you got the number of your contacts? Thanks

Developer
Posts: 148
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: Size of my all contacts in bytes

Hi,

 

ContactListFilters filters;
filters.setLimit(limit);
QList<bb::smileytongue:im::contacts::Contact> contactList = m_contactService->contacts(filters);
sizeOfContacts = contactList.size();


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.