×

Discussion Board

Results 1 to 5 of 5

Thread: PIM access.

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    6

    PIM access.

    Hello,

    I'm using the following code to access PIM:

    Code:
    void CPbAppUi::GetNumberFromPhonebook(TDes& aPhoneNumber)
    {
    	RPbkViewResourceFile phonebookResource(*(CEikonEnv::Static()));
    	if (!phonebookResource.IsOpen())
    		phonebookResource.OpenL();
    
    	CPbkContactEngine* iPbkContactEngine = CPbkContactEngine::NewL();
    
    	// Add searching array to parameters
    	CContactDatabase::TContactViewFilter filter(CContactDatabase::ESmsable);
    	CPbkMultipleEntryFetchDlg::TParams params;
    	params.iContactView = &iPbkContactEngine->FilteredContactsViewL(filter);
    
    	// Launch fetching dialog
    	CPbkMultipleEntryFetchDlg* fetchDlg = CPbkMultipleEntryFetchDlg::NewL(params, *iPbkContactEngine);
    	fetchDlg->SetMopParent(this);
    	TInt okPressed = fetchDlg->ExecuteLD();
    
    	if (okPressed)
    	{
    		TBuf<30> phoneNumber;
    
    		TInt paramCount = params.iMarkedEntries->Count();
    
    		// Get the selected contacts id array
    		for (TInt i=0; i<paramCount; ++i)
    		{
    			const TContactItemId cid = (*params.iMarkedEntries)[i];
    
    			// Open the selected contact using Phonebook engine, choose correct number (launch list query if needed)
    			CPbkContactItem* pbkItem = iPbkContactEngine->ReadContactLC(cid);
    
    			TPbkContactItemField* tmp;
    			tmp = pbkItem->FindField(EPbkFieldIdPhoneNumberMobile);
    			if ((tmp = pbkItem->FindField(EPbkFieldIdPhoneNumberMobile)) != NULL)
    			{
    				phoneNumber = tmp->Text();
    			}
    			else if ((tmp = pbkItem->FindField(EPbkFieldIdPhoneNumberGeneral)) != NULL)
    			{
    				phoneNumber = tmp->Text();
    			}
    		}
    
    		aPhoneNumber = phoneNumber;
    	}
    }
    The problem is that with this code, if the number is not stored on the phone then I would have to create a new contact using the phone's own PIM so that I would have it with my code. I'm guessing the problem is with CPbkMultipleEntryFetchDlg which only lists phone numbers. Is there anything else that I can use which would provide me with the ability to enter a number direct along with listing the stored ones?

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    6

    Re: PIM access.

    Can anyone help me out here?

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: PIM access.

    Phone book APIs are indeed just handling the data stored in Phone book.

    If you application is showing the number in a text editor for exmaple, you could maybe make it editable, thus allowing users to input new nunbers. Or have a query dilaog asking it etc. basically its upto your own logic how you dould like to handle it.

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    6

    Re: PIM access.

    Well, the CPbkMultipleEntryFetchDlg I'm currently using presents a dialog similar to the phone's PIM, with a search box on the bottom, and a list of the phone numbers stored. It doesn't have the CBA "Options" command found on the phone's PIM however and I can't seem to change the search box to enter a number; I really wouldn't want to do that anyway. So my only option here is to add the "Options" command to CPbkMultipleEntryFetchDlg CBA or use some other class I guess, as I want to keep it as simple as possible for the user, where he can manipulate destination number(s) from only one screen. Any thoughts?

  5. #5
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    105

    Re: PIM access.

    did you find the way . I only want to show all phone on applicate long runing and always has the new phones of system .

Similar Threads

  1. Nokia 6101 Locked 2 TMobile Midlet can't access internet...
    By Jason Glass in forum Mobile Java Networking & Messaging & Security
    Replies: 45
    Last Post: 2007-11-14, 02:19
  2. PIM access on Nokia 6030
    By nareshdhiman in forum Mobile Java General
    Replies: 6
    Last Post: 2007-03-08, 05:57
  3. JSR-75 PIM Access Problem on 6230i
    By CWFR in forum Mobile Java General
    Replies: 1
    Last Post: 2005-10-21, 12:59
  4. MIdlet Access PIM - Urgent
    By MobileCharlie in forum Mobile Java General
    Replies: 1
    Last Post: 2003-07-19, 09:35

Posting Permissions

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