×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    50

    Smile j2me - contact list and event list

    Hello,
    I have an application that must write on the calendar appointments and contacts in the address book of personal phone.
    I installed the application on several phones nokia and though I had different results:
    - nokia 6110 Navigator: I had no problem, except that every time I wrote the contact
    - nokia 70: I do not insert anything, nor the appointment in the calendar or address book contact
    - nokia 6234: I inserted the appointment but I do not write in phone
    - nokia 6630: I had no problem, except that every time I wrote the contact

    I know someone help solve these problems?
    thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: j2me - contact list and event list

    Hi chia_84,

    try adding some details to your problem description as, for example:

    * which Exceptions (if any) you get within your code, on the various devices
    * which is the code that throws that Exception, or that gives this problem

    Pit

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    50

    Re: j2me - contact list and event list

    hello Pit,
    The class that I insert the contact in the phone book I found on the Internet .. this gives me only a few problems with the device (n70, 6234).
    The class is as follows, of course adapted to my problem:
    Code:
    public class PIMImpl extends Thread
    {
    static Alert check;
     
    StringItem si;
    //----------------------------------------Phone Book---------------------------------
     
    	int noOfRecords;
    	public static boolean pimTemp = false;
    	Random randPh = new Random();
     
     
    	public PIMImpl()
    	{
     
    	}
     
        public void run()
        {
    		writeData();
        }
     
     
     
    public synchronized void writeData()
    {
     
    /*String ph[] = new String[PIMWrite.names.length];
          for (int i=0;i<PIMWrite.names.length ;i++ )
          {			
     
    			String r = Long.toString(randPh.nextLong());
    			if(r.startsWith("-"))
    			{ 
    				r = r.replace('-','9');
    			}
    			ph[i] =(r.length()>10)?(r.substring(0,10)):(r);
     
     
          
    //	  System.out.println(" PH :"+ph[i] +"i:"+i);
    	  }*/
     
     
    	int tc = 0;
    	PIM pim; 
        try{
     
    	ContactList contacts = null;
    	ContactList conT = null;
    	pim = PIM.getInstance();
    	 try {
     
    		contacts = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
    	 } catch (PIMException e) {
    		// An error occurred
    		return;
    	 }
        //for(int i=0;i<RiepilogoEspositori.m.length;i++)
    	//{
     
    	 Contact contact = contacts.createContact();
    	 String[] name = new String[contacts.stringArraySize(Contact.NAME)];
             String[] ind = new String[contacts.stringArraySize(Contact.ADDR)];
    	  
    //	  System.out.println("i = "+i);
    	 
             if (contacts.isSupportedField(Contact.TEL))
    	 {
    		 contact.addString(Contact.TEL, Contact.ATTR_NONE, RiepilogoEspositori.D);
    	 }
             if (contacts.isSupportedField(Contact.TEL))
    	 {
    		 contact.addString(Contact.TEL, Contact.ATTR_FAX, RiepilogoEspositori.ora);
             }
             if (contacts.isSupportedArrayElement(Contact.NAME, Contact.NAME_GIVEN))
    		  name[Contact.NAME_GIVEN] = RiepilogoEspositori.titolo;
    	 contact.addStringArray(Contact.NAME, PIMItem.ATTR_NONE, name);
             if (contacts.isSupportedArrayElement(Contact.ADDR, Contact.ADDR_STREET))
    		  ind[Contact.ADDR_STREET] = RiepilogoEspositori.contenuto;
    	 contact.addStringArray(Contact.ADDR, PIMItem.ATTR_NONE, ind);
             if(contacts.isSupportedField(Contact.EMAIL)){
                 contact.addString(Contact.EMAIL, Contact.ATTR_NONE, RiepilogoEspositori.oraI);
             }
     
    	 
    	 try {
    		  contact.commit();
    	 } catch (PIMException e) {
    		  // An error occured
    	 }
    		//PIMWrite.result.deleteAll();	
    		//String msg=" Contacts Adding :"+i;
    		//si = new StringItem("",msg);
    		//PIMWrite.result.append(si);	
     
    	//}
    	  	check = new Alert("Added","Added ",null,AlertType.CONFIRMATION);
    		check.setTimeout(Alert.FOREVER);
    		//RiepilogoEspositori.class.display.setCurrent(check);	 
     
    	 try {
    		  contacts.close();
    	 } catch (PIMException e) {
    	 }
     
    	}catch(Exception e){
    		String er = e+" ; tc="+tc;
    	check = new Alert( "Response",er,null,AlertType.CONFIRMATION );
    	check.setTimeout(Alert.FOREVER);
     
    	//PIMWrite.display.setCurrent(check);	
    	}
    //	return true;
     
    }
     
    }
    While the inclusion of events on the calendar, I managed all the exceptions, I only have problems on nokia n70.

    chia_84

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: j2me - contact list and event list

    chia_84,

    your first message is incomplete.

    I am guessing that on 6630 and 6110 you were trying to say
    "I had no problem, except that every time I wrote the contact" a confirmation was asked
    Is this correct assumption?

    If yes, see this known issue
    http://wiki.forum.nokia.com/index.ph...iting_PIM_data

    Hartti

  5. #5
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: j2me - contact list and event list

    Hi chia_84,

    you should try to identify which code lines are giving you problems, and report also which kind of problem and Exception you're getting.

    With these informations, it'll be quite easier to spot out which is the cause of your issues.

    Pit

Similar Threads

  1. application error with 3gp file in J2ME
    By ruchig_iic in forum Mobile Java Media (Graphics & Sounds)
    Replies: 10
    Last Post: 2012-01-16, 21:40
  2. List Box Key Event Problem
    By pavan in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-09-22, 09:07
  3. Replies: 3
    Last Post: 2008-08-11, 13:13
  4. handle list box event in Carbide .
    By ankushbabrekar in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2007-04-10, 06:43
  5. Replies: 3
    Last Post: 2006-11-30, 14:30

Posting Permissions

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