×

Discussion Board

Results 1 to 7 of 7

Thread: group name

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    47

    group name

    Hi everyone ,
    Is it possible to write application which will display the group name of incoming call on the screen when i incoming call is active.

    thx

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: group name

    Hi,

    I don't know if there is a direct way, but when you catch a call you know the identity of the caller. There is an API for getting list of all groups, so go through list of those groups and compare the TContactItemId of caller with the all contacts form group.

    Note that one contact could be in more than one group.

    BR
    STeN

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: group name

    Yes! Although the APIs to use for achieving this are dependent on the platform version you are working on.

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    47

    Re: group name

    thank you guys for the reply.
    I am working on s60 2nd edition.

  5. #5
    Registered User
    Join Date
    Oct 2007
    Posts
    47

    Re: group name

    Quote Originally Posted by stenlik View Post
    Hi,

    I don't know if there is a direct way, but when you catch a call you know the identity of the caller. There is an API for getting list of all groups, so go through list of those groups and compare the TContactItemId of caller with the all contacts form group.

    Note that one contact could be in more than one group.

    BR
    STeN
    Hi stenlik,
    I have catched the incoming call number, I think i must compare the number with database,its fine till here.
    i want to know is it possible to display the group name of the incoming call number. when the phone is ringing.

    thx

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: group name

    Hi,

    1/ Once you have the phone number you have to obtain the ID (TContactItemId) of the contact. Note that there could be more than one contact in the phone book with the same phone number -> then take the first one. There is the nice phone book API available + some AVKON wrappers, which makes the use of the API easier.

    2/ Then get all groups and its members and compare the caller TContactItemId with all TContactItemId of all members of groups. As previously note that the contact can be in more than one group.

    In other words there is what I have described in pseudo code:

    TContactItemId callerId = GetCallerId( aCallerMSISDN );

    Groups* groups = GetAllGroups();

    for( TInt i = 0; i < groups->Count(); i++ )
    {
    for ( TInt j = 0; groups[i]->Count() ;j++ )
    {
    if ( callerId == groups[i][j]->CallerId()
    {
    // WE GOT II!!!
    break;
    }
    }
    }

    BR
    STeN

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    47

    Re: group name

    hi this is my code see it,
    i am able to retreive the incoming call number but i am unable to compare . i dont know to compare it.
    RMobileCall m_currentCall;

    m_currentCall.OpenExistingCall(iLine,iCallName);


    RMobileCall::TMobileCallInfoV1 callInfo;
    RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(callInfo);

    m_currentCall.GetMobileCallInfo(callInfoPckg);

    TBuf8<20> aCallNumber;
    aCallNumber.Copy(callInfo.iRemoteParty.iRemoteNumber.iTelNumber);

    ifile.Write(aCallNumber);
    /*TContactItemId callerId = GetCallerId( aCallerMSISDN );

    Groups* groups = GetAllGroups();

    for( TInt i = 0; i < groups->Count(); i++ )
    {
    for ( TInt j = 0; groups[i]->Count() ;j++ )
    {
    if ( callerId == groups[i][j]->CallerId()
    {
    // WE GOT II!!!
    break;
    }
    }
    }*/
    TBuf8<20> *data;

    iContactDatabase = CContactDatabase::OpenL();
    iGroupIdArray = iContactDatabase->GetGroupIdListL();
    TInt zGroupCount = iGroupIdArray->Count();

    for(TInt z=0; z<zGroupCount; z++)
    {
    TContactItemId zContactItemId = (*iGroupIdArray)[z];
    iContactItem = iContactDatabase->ReadContactL(zContactItemId);
    CContactItemFieldSet& zContactItemFieldSet = iContactItem->CardFields();
    TInt zContactFieldCount = zContactItemFieldSet.Count();
    for(TInt j=0; j<zContactFieldCount; j++)
    {
    // CContactNumberField& zContactFieldItem = (zContactItemFieldSet)[j];

    CContactItemField& zContactFieldItem = (zContactItemFieldSet)[j];
    iContactTextField = zContactFieldItem.TextStorage();
    //iContactNumberField = zContactFieldItem.NumberStorage();


    data->Copy(iContactTextField->Text()); /// this function return group name
    // data->Copy(iContactNumberField->Value())

Similar Threads

  1. CONE 44 panic when deleting tab group
    By guderian1 in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-05-22, 11:13
  2. Access Point Group
    By fransgunawan in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-07-07, 08:50
  3. Replies: 0
    Last Post: 2006-02-22, 06:15
  4. how to create a sub group gui in series 60 contact
    By csymbian in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-10-01, 19:20
  5. how create a sub group
    By csymbian in forum Symbian
    Replies: 0
    Last Post: 2004-09-27, 16:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×