how to read all entries of contactdatabase[resolved]

Login to reply to this topic.
Tue, 2005-07-26 14:19
Joined: 2004-12-23
Forum posts: 239
Hi All

I want to read all the fields of contactdatabase
how can i read it
Can any one help me?
TIA

---------------
Bhatt Kavita


Wed, 2005-07-27 03:54
Joined: 2005-03-03
Forum posts: 56
Re: how to read all entries of contactdatabase
You can search for a document on this in forum nokia site.
the name of the doc is using contacts api or something of that sort.

hope this helps
Wed, 2005-07-27 06:18
Joined: 2005-04-01
Forum posts: 118
Re: how to read all entries of contactdatabase
HI SYMBIANS

search SDK documentation for "Contacts model constants"
and try to fetch information from contact database with those constants.

Prashant {prashu}

Wed, 2005-07-27 10:55
Joined: 2004-12-23
Forum posts: 239
Re: how to read all entries of contactdatabase
thanks ArunLee and Prashu

---------------
Bhatt Kavita

Wed, 2005-07-27 11:00
Joined: 2005-04-01
Forum posts: 118
Re: how to read all entries of contactdatabase
u r welcome.

is it solved u r problem?

Prashant {prashu}

Wed, 2005-07-27 13:08
Joined: 2004-12-23
Forum posts: 239
Re: how to read all entries of contactdatabase
Actually i m searching more for my solution but ur quote helps me lot .
Thanks

---------------
Bhatt Kavita

Wed, 2005-07-27 13:17
Joined: 2005-04-01
Forum posts: 118
Re: how to read all entries of contactdatabase
ok
if u'll explain more abt ur problem then anyone can give u nearest solution.

Prashant {prashu}

Thu, 2005-07-28 06:48
Joined: 2004-12-23
Forum posts: 239
Re: how to read all entries of contactdatabase
Actually i have found no of contacts and no off ield in particular record..
But how to proceed further for reading those entries so tat i can store it into a database.
Can anybody help me..

---------------
Bhatt Kavita

Thu, 2005-07-28 10:42
Joined: 2004-12-23
Forum posts: 239
Re: how to read all entries of contactdatabase
hi i have picked firstname,last name,mail,fax,company
but how to pick
job
mobile
genearl(telephone no.) i
i m not finding any uids in contacts model for these three can u help me

---------------
Bhatt Kavita

Thu, 2005-07-28 11:27
Joined: 2005-04-01
Forum posts: 118
Re: how to read all entries of contactdatabase
hi check these

job = KUidContactFieldJobTitle

mobile = KUidContactFieldPhoneNumber

general(telephone no) = KUidContactFieldPhoneNumber

actually "KUidContactFieldPhoneNumber" giving both mobile and telephone no. by creating entry
for each.

Prashant {prashu}

Thu, 2005-07-28 12:17
Joined: 2004-12-23
Forum posts: 239
Re: how to read all entries of contactdatabase
KUidContactFieldPhoneNumber
giving me same number both for telephone(general)and mobile.
It gives me telephone number for mobile.

---------------
Bhatt Kavita

Fri, 2005-07-29 08:15
Joined: 2005-04-01
Forum posts: 118
Re: how to read all entries of contactdatabase
Quote from: mesweetie
KUidContactFieldPhoneNumber

Hi this id returning both numbers try some way to SHOw them.

Prashant {prashu}

Fri, 2005-07-29 08:42
Joined: 2004-11-05
Forum posts: 57
Re: how to read all entries of contactdatabase
This code runs through all fields of a given contact.


  CContactItem* card = contactsDb->ReadContactL(cardId);
  CleanupStack::PushL(card);

  // get fields
  CContactItemFieldSet& fields = card->CardFields();

  // read no of fields this contact has
  TInt fieldsNo = card->CardFields().Count();

  CDesCArray *text_array = new (ELeave) CDesCArrayFlat(1);

  // go through all contast's fields
  for( TInt i(0); i<fieldsNo; ++i )
    {
    // get current field
    const CContactItemField& field = fields[i];

    TStorageType storageType = field.StorageType() ;
    TPtrC labelText = field.Label();
    TPtrC fiedText = field.TextStorage()->Text();



If you want to get spesific kins of fields, do

  // get fields
  CContactItemFieldSet& fields = card->CardFields();
  TInt fieldsNo = card->CardFields().Count();

  TInt datapos = fields.FindNext(KUidContactFieldPhoneNumber);  // important step

  while (datapos != KErrNotFound)
    {
     TPtrC number = fields[datapos].TextStorage()->Text();
     
      if (datapos+1<fieldsNo)
   datapos = fields.FindNext(KUidContactFieldPhoneNumber,datapos+1);
      else datapos = KErrNotFound;
    }


Is this a kind of answer you wanted?
Fri, 2005-07-29 09:12
Joined: 2004-12-23
Forum posts: 239
Re: how to read all entries of contactdatabase
 hi
thanks magsus and prashu
magsus ur trick resolved my problem
Thanks again
Regards

---------------
Bhatt Kavita

  • Login to reply to this topic.