×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    11

    Post Read contacts from phonebook.

    Hi experts,
    I am new to windows phone development, I want to read all contacts from phonebook in my application.
    I referred following link.
    http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx
    But this link gives me information about search particular contact from phonebook.
    I want to retrieve all contact from phonebook or is it possible to display phonebook and get select contacts from phonebook.
    Please somebody help me, how can I do this?
    Last edited by prashantchougule; 2013-04-05 at 06:44.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Read contacts from phonebook.

    hello prashantchougule,

    does a phonenumberchoosertask will help you here http://msdn.microsoft.com/en-us/wind...serslab_topic2 !!

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Read contacts from phonebook.

    Here is the way to do it,

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
    Contacts cts = new Contacts();
    cts.SearchCompleted += cts_SearchCompleted;
    cts.SearchAsync("", FilterKind.None, "");
    }

    void cts_SearchCompleted(object sender, ContactsSearchEventArgs e)
    {
    foreach (Contact ct in e.Results)
    {
    MessageBox.Show(ct.DisplayName.ToString());
    }
    }

  4. #4
    Registered User
    Join Date
    Jul 2012
    Posts
    11

    Re: Read contacts from phonebook.

    thank you guys for helping me.
    I think phonenumberchoosertask allow to select only one contact at a time.
    Is it possible to select multiple contacts at a time?

  5. #5
    Nokia Developer Champion
    Join Date
    Sep 2012
    Location
    Morocco
    Posts
    295

    Re: Read contacts from phonebook.

    Hello !
    This was already answer Contact Api In WP.
    And you already had the right link(MSDN), Also mehul_raje gave you the right answer, to search for all contacts you just need to search for an empty string
    using mehul_rajae snippet
    Code:
    Contacts cts = new Contacts();
    cts.SearchCompleted += cts_SearchCompleted;
    
    cts.SearchAsync("", FilterKind.None, ""); //or cts.SearchAsync(String.Empty,)

Similar Threads

  1. How to write contacts in phonebook
    By susmitham in forum Mobile Java General
    Replies: 3
    Last Post: 2010-05-05, 17:01
  2. Need help to access contacts from phonebook
    By amol_benare604 in forum Symbian
    Replies: 2
    Last Post: 2009-04-29, 08:30
  3. About Encryption of Contacts in PhoneBook
    By jennie in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2007-10-12, 07:45
  4. How to read contacts from PhoneBook?
    By jennie in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-09-13, 08:58
  5. How do I read phonebook Contacts using PIM API in N70
    By ayan_sen in forum Mobile Java General
    Replies: 4
    Last Post: 2007-07-30, 22:33

Posting Permissions

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