×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    78

    Post SonyEricsson Adding contact details

    hi,

    I am doing a j2me contact details application ....am attaching my code below..

    Code:
    public void addDetails(){
            csize=0;
            int reainingsize=0;
            try {            
                Contact contact          =   null;
                PIM pimInst              =   PIM.getInstance();
                contactList              =   (ContactList) pimInst.openPIMList(PIM.CONTACT_LIST,PIM.READ_WRITE);  
                    
                contact                  =   contactList.createContact();             
                csize                    =   csize + 1; //indicates number of cotacts added to phonedatabase
                String[] name            =   new String[contactList.stringArraySize(Contact.NAME)];
                /*    name[Contact.NAME_GIVEN]  = "Manju";
                      name[Contact.NAME_FAMILY] = "Varma";
                      
                      contact.addStringArray(Contact.NAME, Contact.ATTR_NONE,name);                 
                      contact.addString(Contact.TEL, Contact.ATTR_NONE,"544545");                   
                      contact.addString(Contact.TEL, Contact.ATTR_HOME,"2122555");                 
                      contact.addString(Contact.TEL, Contact.ATTR_WORK,"54455");
                      contact.addString(Contact.TEL, Contact.ATTR_MOBILE,"75565565"); 
                      contact.addString(Contact.TEL, Contact.ATTR_MOBILE,"949655555"); 
                      contact.addString(Contact.TEL, Contact.ATTR_MOBILE,"2586987321"); 
                      contact.addString(Contact.TEL, Contact.ATTR_MOBILE,"3333333333"); 
                      contact.addString(Contact.TEL, Contact.ATTR_MOBILE,"5565656565656"); 
                      contact.addString(Contact.TEL, 24 ,"45444");                    
                      contact.addString(Contact.TEL, 528 ,"5788444");                                
                      contact.addString(Contact.EMAIL,Contact.ATTR_OTHER,"anju@aarthikaindia.com");  */
                       
                
                
                if(contactList.isSupportedField(contact.TEL)){
                      contact.addString(Contact.TEL,PIMItem.ATTR_NONE,"800-888-8888");
                      contact.addString(Contact.TEL,PIMItem.ATTR_NONE,"800-888-8889");
                }
                
                if (contactList.isSupportedField(contact.ORG))
                      contact.addString(Contact.ORG, PIMItem.ATTR_NONE,"Rain ,Inc.");
                
                if(contactList.isSupportedField(contact.EMAIL))
                      contact.addString(Contact.EMAIL,PIMItem.ATTR_NONE,"support@acme.com");
            
                contact.commit();         
               
            }catch (PIMException ex) {            
                           
            }
            finally{
                if (contactList != null){
                        try {
                            contactList.close();
                        } catch (PIMException ex) {
                            ex.printStackTrace();
                        }
                        contactList = null;
               }
            }
    }

    where the above code works fine in the Nokia phone but when i run the above code in a Sony-Ericsson phone am getting a Exception
    Can anyone solve the above problem.



    With Regards
    Deva

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: SonyEricsson Adding contact details

    Hello Deva,

    this is a guess of mine (as I do not have any Sony Ericsson devices at disposal), but it could be that that SE device does not support one of those Contact.* field values, either when used multiple times (similarly to this Known Issue specific for Nokia devices in Forum Nokia Wiki: KIJ001311 - Total number of e-mail addresses conflicts the set maximum in Series 40) or otherwise.

    Have you checked which one of the two PIMExceptions in your code gets thrown?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: SonyEricsson Adding contact details

    You might also, for Sony Ericsson related development issues, check out Sony Ericsson's developer support site and discussion forums: http://developer.sonyericsson.com/wp...me?cc=gb&lc=en

Similar Threads

  1. Adding contact fails
    By Emil_Gunnarsson in forum Mobile Java General
    Replies: 7
    Last Post: 2010-06-07, 11:19
  2. Adding contact image to alarm
    By rinyogi03 in forum Symbian
    Replies: 1
    Last Post: 2009-11-12, 06:20
  3. Problem with adding contact
    By deepbeat in forum Symbian
    Replies: 1
    Last Post: 2006-05-08, 07:23
  4. contact database change event details
    By rsajithali in forum Symbian
    Replies: 9
    Last Post: 2004-08-17, 00:55
  5. Problem adding contact
    By jsstewart in forum Symbian
    Replies: 1
    Last Post: 2004-02-17, 13:22

Posting Permissions

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