日期:2014-05-20  浏览次数:20758 次

读取手机的通讯录
为什么下面的代码读去通讯录(已经存在),sun的wtk会提示问是否要读取通讯录?当我按下是的,而模拟器没有放映,
我用Nokia_S40_DP20_SDK_1_1把jad导入运行时,提示的却是cannotdefounderror为什么啊???
import   gov.nist.siplite.header.ContactList;

import   java.io.*;
import   java.util.Enumeration;

import   javax.microedition.lcdui.*;
import   javax.microedition.midlet.*;
import   javax.microedition.pim.Contact;
import   javax.microedition.pim.PIM;
import   javax.microedition.pim.PIMException;
import   javax.microedition.pim.PIMList;

import   org.kxml.io.AbstractXmlWriter;
import   org.kxml.io.XmlWriter;

public   class   f   extends   MIDlet   implements   CommandListener  
  {

          private   Display       display;      
  private       Command   exitCommand,okCommand;
//   private   TextBox   textbox;
  private   Alert   alert;
  public   String   tagTable[]   =   {
                  "id ",
              "firstname ",
              "mun "
      };
        public   f(){
        display   =   Display.getDisplay(   this   );
       
       
        alert=new   Alert( "alert ", "Are   you   start   xml   form   contact? ",null,AlertType.INFO);
                exitCommand   =   new   Command(   "Exit ",     Command.EXIT,   1   );
                okCommand=new   Command( "statxml ",Command.OK,1);
         
              alert.addCommand(exitCommand);
              alert.addCommand(okCommand);
              alert.setCommandListener(this);
        }
        public   void   commandAction(   Command   c,   Displayable   d   ){
                if(   c   ==   exitCommand   )
                {    
                  destroyApp(   false);
                  notifyDestroyed();
                }else   if(c==okCommand)
                  {
                    try  
                    {
                            testXML();
                            }catch(   Exception   e   )
                              {
                                  System.err.println(   "Exception   "   +   e   );