Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 32

Hybrid View

  1. #1
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Question Retrieve SIM contacts

    Hi all,

    Is it possible to retrieve the sim contacts?
    Here its possible to retrieve the contacts from phone contacts only.
    How to retrieve the sim contacts and add the new contact to sim?



    Regards,
    Bharath.C

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Quote Originally Posted by bhakki View Post
    Hi all,

    Is it possible to retrieve the sim contacts?
    Here its possible to retrieve the contacts from phone contacts only.
    How to retrieve the sim contacts and add the new contact to sim?

    Regards,
    Bharath.C
    Yes, all this is possible on using JSR -75 PIM api's on Nokia S40 devices.

    refer to FN wiki -
    http://wiki.forum.nokia.com/index.ph...ook_in_Java_ME
    http://wiki.forum.nokia.com/index.ph...act_in_Java_ME
    http://wiki.forum.nokia.com/index.ph...cts_in_Java_ME

    or refer to PDAPDemo PIM example of WKT

    using String[] lists = pim.listPIMLists(PIM.CONTACT_LIST);

    Code:
    PIM pim = PIM.getInstance();
    String[] lists = pim.listPIMLists(PIM.CONTACT_LIST); // you get the list 0 and 1, where 0 is sim list and 1 is phone book list
    for (int i = 0; i < lists.length; i++) // get both phone book memorry and SIM card
    				{
    					PIMList list = null;
    					try
    					{
    						list = pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY, lists[i]);
    					}
    					catch (PIMException e)
    					{
    					}
    // do what you want with the PIM list of both  add,edit,delete and then close the list.
    }
    Thanks,
    Ekta

  3. #3
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: Retrieve SIM contacts

    Is this working for you?
    I cant retrieve the SIM contacts.
    I can retrieve Only phonecontacts.
    How to retrieve the SIM contacts?


    Regards,
    Bharath...

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Quote Originally Posted by bhakki View Post
    Is this working for you?
    I cant retrieve the SIM contacts.
    I can retrieve Only phonecontacts.
    How to retrieve the SIM contacts?


    Regards,
    Bharath...
    On which device you are testing it ?

    just try this:
    PIM pim = PIM.getInstance();
    String[] lists = pim.listPIMLists(PIM.CONTACT_LIST); // you get the list 0 and 1, where 0 is sim list and 1 is phone book list
    And print the no. of lists you get in this Response.....

    Using this you can access SIM contact book on S40, I have tested this on Nokia 6500 slider.
    Thanks,
    Ekta

  5. #5
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: Retrieve SIM contacts

    I tested on 2700 classic.
    Its reading the SIM numbers.
    But i cant retrieve the values from SIM, It retrieve the phone contacts value only.


    Regards,
    Bharath.c

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Quote Originally Posted by bhakki View Post
    I tested on 2700 classic.
    Its reading the SIM numbers.
    But i cant retrieve the values from SIM, It retrieve the phone contacts value only.


    Regards,
    Bharath.c
    You say "Its reading the SIM numbers" but you cant retrieve the values from SIM.... what do you mean by this... if you are able read the contact Objects from SIM card... you are not able to get the phone numbers or name. Are you trying Contact.FormatedName or only Contact.Name or Contact.Tel?
    Thanks,
    Ekta

  7. #7
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: Retrieve SIM contacts

    Thanks Ekta....

    Most of the problem was solved but i have 1 more problem.
    I cant retrieve the some telephone number from phone contacts.
    I was created the contact as general format.
    I used all attributes for retrieve the telephone numbers.
    Like,

    int phoneNumbers = c.countValues(Contact.TEL);

    if (value == Contact.TEL && phoneNumbers > 0) {


    for (int i = 0; i < phoneNumbers; i++) {
    if (c.getAttributes(Contact.TEL, i) == Contact.ATTR_HOME) {
    String homeNo = c.getString(Contact.TEL, i);

    } else if (c.getAttributes(Contact.TEL, i) == Contact.ATTR_FAX) {

    String faxNo = c.getString(Contact.TEL, i);

    } else if (c.getAttributes(Contact.TEL, i) == Contact.ATTR_WORK) {

    String workNo = c.getString(Contact.TEL, i);

    } else if (c.getAttributes(Contact.TEL, i) == Contact.ATTR_MOBILE) {

    String mobileNo = c.getString(Contact.TEL, i);

    } else if (c.getAttributes(Contact.TEL, i) == Contact.ATTR_NONE || c.getAttributes(Contact.TEL, i) == Contact.ATTR_OTHER || c.getAttributes(Contact.TEL, i) == Contact.ATTR_AUTO || c.getAttributes(Contact.TEL, i) == Contact.ATTR_PREFERRED || c.getAttributes(Contact.TEL, i) == Contact.ATTR_ASST || c.getAttributes(Contact.TEL, i) == Contact.ATTR_PAGER || c.getAttributes(Contact.TEL, i) == Contact.ATTR_SMS) {

    String otherNo = c.getString(Contact.TEL, i);

    }


    Is this correct?
    Some telephone numbers not comes into the any conditions.

    Regards,
    Bharath...
    Last edited by bhakki; 2010-06-22 at 12:20.

  8. #8
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Some telephone don't come because they might not be defined in this way -
    try
    Code:
    // Numbers
            private static String[] attrDescList = 
    	{
    		ATTR_ASST, ATTR_AUTO, ATTR_FAX, ATTR_HOME, ATTR_MOBILE, ATTR_OTHER, ATTR_PAGER, ATTR_PREFERRED, ATTR_SMS, ATTR_WORK
    	};
    	int n = contact.countValues(Contact.TEL); 
    	if(n>0)
    	{
    		for (int k = 0; k < n; k++)
    		{
    		int attrs = contact.getAttributes(Contact.TEL, k);
    		try
    		{
    			String tel = contact.getString(Contact.TEL, k);
    			System.out.println("attrs: "+attrDescList [attrs]+ "       " +Tel :" +tel);
    		}
    		catch (IndexOutOfBoundsException ex)
    		{
    		}
    	        }
    	}
    Thanks,
    Ekta

  9. #9
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: Retrieve SIM contacts

    Hi,

    I think this is problem with s40 series mobiles.
    Because this problem only occured when i retrieving the contact as general format.
    I dont know How to resolve this issue????

    I got the contact.countValues(Contact.TEL) is 0 when i retrieving the general contacts in s40 mobiles.
    So i cant get the telephone number.

    Is there any way to get the general contact number from phone contacts in s40 series mobiles?
    Bharath... :)

  10. #10
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Quote Originally Posted by bhakki View Post
    Hi,

    I think this is problem with s40 series mobiles.
    Because this problem only occured when i retrieving the contact as general format.
    I dont know How to resolve this issue????

    I got the contact.countValues(Contact.TEL) is 0 when i retrieving the general contacts in s40 mobiles.
    So i cant get the telephone number.

    Is there any way to get the general contact number from phone contacts in s40 series mobiles?
    http://library.forum.nokia.com/index...59BE55914.html

    On S40 see you can get both the Contact list from phone memory and Sim cards. I have tested this on Nokia 6500 slider and few other devices like 3110 etc.
    Are you testing it on real device ? try on some other device --- also try SUN WTK PDAPDemo PIM example on your target devices and see what all it is able to read from PIM
    Thanks,
    Ekta

  11. #11
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: Retrieve SIM contacts

    I tested PDAPDemo on real time nokia 2700 classic mobile.
    Here also i faced same problem.
    In this application, general contact phone number could not be read.
    Bharath... :)

  12. #12
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Quote Originally Posted by bhakki View Post
    I tested PDAPDemo on real time nokia 2700 classic mobile.
    Here also i faced same problem.
    In this application, general contact phone number could not be read.
    In this case try contact.getFields(); and then read all fields returned by this, to find what is stored where.
    Thanks,
    Ekta

  13. #13
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: Retrieve SIM contacts

    Ok. but i got contact.countValues(Contact.TEL) is 0.
    So i cant get the telephone number.
    Bharath... :)

  14. #14
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Retrieve SIM contacts

    Quote Originally Posted by bhakki View Post
    Ok. but i got contact.countValues(Contact.TEL) is 0.
    So i cant get the telephone number.
    Check the phone no may be stored in any other field...
    Thanks,
    Ekta

  15. #15
    Registered User
    Join Date
    Jun 2010
    Posts
    1

    Re: Retrieve SIM contacts

    Hey guys,
    I have a Nokia 3720 Classic. How can I retrieve the deleted contacts from my SIM card?

Similar Threads

  1. Retrieve SIM contacts
    By bhakki in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-06-17, 18:16
  2. how to retrieve contacts
    By abhimanyu1 in forum Symbian
    Replies: 2
    Last Post: 2009-08-17, 23:41
  3. How to retrieve contacts from SIM memory.
    By smanikandan14 in forum Symbian
    Replies: 1
    Last Post: 2009-07-14, 08:15
  4. Replies: 5
    Last Post: 2009-06-09, 09:05
  5. [split] Copy contacts to SIM (was Re: Dual SIM devices)
    By jalpesh_patel17 in forum General Development Questions
    Replies: 10
    Last Post: 2008-10-06, 16:28

Posting Permissions

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