亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? listing 12-1.java

?? J2ME開發大全的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
import javax.microedition.pim.*;
import java.util.Enumeration;
import java.util.Calendar;
import java.util.Date;
public class PIMTest  {
    public PIMTest() {
    }
    /**************************************************************************
    * Contact/ContactList sample code
    ***************************************************************************/
    public void createAContact() {
        // Create a support contact entry in the device's 
        //local address book
        // so that the users have has the contact 
        //information for anything that they
        // need help with about your application
        PIM pim = PIM.getInstance();
        ContactList cl = null;
        Contact new_contact = null;
        try {
            // Open write only since you're just going to 
            // add your support contact
            // info to the device's database
            cl = (ContactList) 
              pim.openPIMList(PIM.CONTACT_LIST, PIM.WRITE_ONLY);
        } catch (PIMException e) {
            // failed opening the default contact list!
            // Error case - abort this attempt
            System.err.println(
              "Error accessing database - aborting action");
            return;
        } catch (SecurityException e) {
            // user rejected application's request for 
            //write access to contact list
            // This is not an error condition and can be normal
            System.out.println(
                "Okay, this application won't add the contact");
            return;
        }
        // Create an "empty" contact to work with
        new_contact = cl.createContact();
        // Add your company's info: company name, 
        //two support phone numbers, a support
        // email, and a note about what product the user has.  Add whatever
        // information that the native contact list 
        //supports and don't add it if
        // the field is not supported.
        if (cl.isSupportedField(Contact.ORG))
            new_contact.addString(Contact.ORG, PIMItem.ATTR_NONE, 
               "Acme, Inc.");
        if (cl.isSupportedField(Contact.TEL)) {
            new_contact.addString(Contact.TEL, PIMItem.ATTR_NONE, 
              "800-888-8888");
            new_contact.addString(Contact.TEL, PIMItem.ATTR_NONE, 
              "800-888-8889");
        }
        if (cl.isSupportedField(Contact.EMAIL))
            new_contact.addString(Contact.EMAIL, 
               PIMItem.ATTR_NONE, "support@acme.com");
        if (cl.isSupportedField(Contact.NOTE))
            new_contact.addString(Contact.NOTE, PIMItem.ATTR_NONE, 
              "You've purchased application XXX with registration number NNN.");
        try {
            // commits it to the list and the native database
            new_contact.commit(); // commits it to the list and the native database
        }
        catch (PIMException e) {
            // failed committing the contact
             System.err.println(
                "This application cannot add the contact info");
       }
        try {
            cl.close();
        } catch (PIMException e) {
            // failed to close the list
        }
    }
    public void retrieveContacts() {
        // Get all contacts with last name starting with "S" (e.g.
        // Smith, Sanders, Stargell, etc.) for a listing screen
        PIM pim = PIM.getInstance();
        ContactList cl = null;
        Contact search_template = null;
        Enumeration s_contacts = null;
        try {
            cl = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, 
                  PIM.READ_ONLY);
        } catch (PIMException e) {
            // failed opening the default contact list!
            System.err.println(
                   "Error accessing database - aborting action");
            return;
        } catch (SecurityException e) {
            // user rejected application's request for 
            // read access to contact list
            // This is not an error condition and can be normal
            System.out.println(
               "Okay, this application won't get contacts");
            return;
        }
        // first create a "template" contact which we'll use for matching
        search_template = cl.createContact();
        if (cl.isSupportedArrayElement(Contact.NAME, 
              Contact.NAME_FAMILY)) {
            // this particular contact list does contain last names, so we
            // can now do the search
            // now fill in the search parameters of last name 
            // starting with 'S'
            String[] name_struct = new String[Contact.NAMESIZE];
            name_struct[Contact.NAME_FAMILY] = "S";
            search_template.addStringArray(Contact.NAME, 
                  PIMItem.ATTR_NONE, name_struct);
        }
        else if (cl.isSupportedField(Contact.FORMATTED_NAME)) {
            // the contact implementation doesn't have individual  name
            // fields, so try the single name field FORMATTED_NAME
            search_template.addString(Contact.FORMATTED_NAME, 
                PIMItem.ATTR_NONE, "S");
        }
        try {
            // Get the enumeration of matching elements
            s_contacts = cl.items(search_template);
        } catch (PIMException e) {
            // failed to retrieve elements due to error!
            System.err.println(
                "This application cannot retrieve the contacts");
         }
        try {
            cl.close();
        } catch (PIMException e) {
            // failed to close the list
        }
    }
    public void modifyAContact() {
        // Code sample:
        // Update John Smith's home phone number 
        // from "555-0000" to "555-1212"
        // since he moved...
        PIM pim = PIM.getInstance();
        ContactList cl = null;
        Enumeration contacts = null;
        try {
            cl = (ContactList) pim.openPIMList(
                 PIM.CONTACT_LIST, PIM.READ_WRITE);
        } catch (PIMException e) {
            // failed opening the default contact list!
            System.err.println(
                 "This application failed to open the contact list");
        } catch (SecurityException e) {
            // user rejected application's request 
            // for read/write access to contact list
            // This is not an error condition and can be normal
            System.out.println(
               "Okay, this application won't get contacts");
            return;
        }
        // first create a "template" contact which we'll use for matching
        // to find John Smith's contact entry
        Contact template = cl.createContact();
        String tel_number = "";
        if (cl.isSupportedField(Contact.NAME)) {
            String[] name_struct = new String[Contact.NAMESIZE];
            name_struct[Contact.NAME_FAMILY] = "Smith";
            name_struct[Contact.NAME_FAMILY] = "John";
            template.addStringArray(
               Contact.NAME, PIMItem.ATTR_NONE, name_struct);
        }
        if (cl.isSupportedField(Contact.TEL)) {
            template.addString(Contact.TEL, Contact.ATTR_HOME, "555-0000");
        }
        try {
            // Get the enumeration of matching elements
            contacts = cl.items(template);
        } catch (PIMException e) {
            // failed retrieving the items enumeration due to an error
            System.err.println(
                "This application cannot retrieve the contact");
        }
        // update all John Smith entries with old home numbers of 555-0000
        while (contacts!= null && contacts.hasMoreElements()) {
            Contact c = (Contact) contacts.nextElement();
            for (int index = c.countValues(Contact.TEL); index != 0; index--) 
            {
                if (c.getString(Contact.TEL, index).equals("555-0000")) {
                    c.setString(Contact.TEL, index, Contact.ATTR_HOME, 
                      "555-1212");
                    try {
                        // save change to the database
                        c.commit();
                    } catch (PIMException e) {
                        // Oops couldn't save the data...
                        System.err.println(
                          "This application cannot commit the contact info");
                    }
                    break; // go to next matching element
                }
            }
        }
        try {
            cl.close();
        } catch (PIMException e) {
            // failed to close the list
        }
    }
    public void deleteContacts() {
        // Delete all contacts at company WorldCom 
        // since they won't be answering
        // phone calls anymore...
        PIM pim = PIM.getInstance();
        ContactList cl = null;
        Enumeration contacts = null;
        try {
            cl = (ContactList) pim.openPIMList(
               PIM.CONTACT_LIST, PIM.READ_WRITE);
        } catch (PIMException e) {
            // failed opening the default contact list!
            System.err.println(
                 "This application failed to open the contact list");
            return;
        } catch (SecurityException e) {
            // user rejected application's request for 
            // read/write access to contact list
            // This is not an error condition and can be normal
            System.out.println(
              "Okay, this application won't get contacts");
            return;
        }
        // first create a "template" contact which we'll use for matching
        // to find WorldCom contact entries
        Contact template = cl.createContact();
        if (cl.isSupportedField(Contact.ORG)) {
            template.addString(Contact.ORG, 
               PIMItem.ATTR_NONE, "WorldCom");
            try {
                // Get the enumeration of matching elements
                contacts = cl.items(template);
            } catch (PIMException e) {
                // failed retrieving the items enumeration due to an error
                System.err.println(
                   "This application cannot commit the contact info");
            }
        }
        // delete all WorldCom entries
        while (contacts != null && contacts.hasMoreElements()) {
            Contact c = (Contact) contacts.nextElement();
            try {
                cl.removeContact(c);
            } catch (PIMException e) {
                // couldn't delete the entry for some 
                // reason (probably shredded)
                System.err.println(
                  "This application cannot remove the contact info");
            }
        }
        try {
            cl.close();
        } catch (PIMException e) {
            // failed to close the list
        }
    }
    /**************************************************************************
    * Event/EventList sample code
    ***************************************************************************/
    public void createAnEvent() {
        // Create an event entry in the device's local calendar
        // reminding the user to register your application
        PIM pim = PIM.getInstance();
        EventList el = null;
        Event new_event = null;
        try {
            // Open write only since you're just going to 
            //add your registration
            // event info to the device's database
            el = (EventList) pim.openPIMList(
                 PIM.EVENT_LIST, PIM.WRITE_ONLY);
        } catch (PIMException e) {
            // failed opening the default event list!
            // Error case - abort this attempt
            System.err.println(
               "Error accessing database - aborting action");
            return;
        } catch (SecurityException e) {
            // user rejected application's request 
            // for write access to event list
            // This is not an error condition and can be normal
            System.out.println(
               "Okay, this application won't add the event");
            return;
        }
        // Create an "empty" event to work with
        new_event = el.createEvent();
        // Add a registration reminder event: 
        // make it two weeks from now with an
        // alarm 10 minutes before the occurrence, and
        // add a note with the phone or email to call.
        if (el.isSupportedField(Event.START)) {
            Date d = new Date();
            long l = d.getTime() + (long)1209600000;
            new_event.addDate(Event.START, PIMItem.ATTR_NONE, l);
        }
        if (el.isSupportedField(Event.ALARM))
            new_event.addInt(Event.ALARM, PIMItem.ATTR_NONE, 600);
        if (el.isSupportedField(Event.SUMMARY))
            new_event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, 
              "Register Your Product!");
        if (el.isSupportedField(Event.NOTE))
            new_event.addString(Event.NOTE, PIMItem.ATTR_NONE, "You've purchased application XXX with registration number NNN. Please register it now.  Look in the Contact List for information on how to contact us.");
        try {
             // commits it to the list and the native database
            new_event.commit(); // commits it to the list and the native database
        }
        catch (PIMException e) {
            // failed committing the event
            System.err.println("This application cannot add the event")
        }
        try {
            el.close();
        } catch (PIMException e) {
            // failed to close the list
        }
    }
    public void retrieveEvents() {
        // Get all events occurring for the coming week, 
        // for a listing screen
        PIM pim = PIM.getInstance();
        EventList el = null;
        Event search_template = null;
        Enumeration this_weeks_events = null;
        try {
            el = (EventList) pim.openPIMList(
              PIM.EVENT_LIST, PIM.READ_ONLY);
        } catch (PIMException e) {
            // failed opening the default event list!
            System.err.println(
                  "Error accessing database - aborting action");
            return;
        } catch (SecurityException e) {
            // user rejected application's request for 
            // read access to event list

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久99精品免费观看不卡| 日韩三级精品电影久久久| 精品综合久久久久久8888| 亚洲高清在线视频| 婷婷国产在线综合| 亚洲妇女屁股眼交7| 亚洲精品中文在线观看| 亚洲自拍偷拍网站| 日本欧美在线看| 久久se精品一区精品二区| 国产精品香蕉一区二区三区| 国产综合色产在线精品| 国产精品99久久久久久似苏梦涵 | 精品裸体舞一区二区三区| 91精品国产91久久久久久最新毛片| 欧美无人高清视频在线观看| 欧美精品久久一区| 国产亚洲成av人在线观看导航 | 亚洲欧美精品午睡沙发| 亚洲精品午夜久久久| 亚洲成在线观看| 日韩综合一区二区| 国产成人亚洲综合a∨婷婷| www.激情成人| 91精品久久久久久蜜臀| 国产精品沙发午睡系列990531| 中文字幕在线观看不卡| 亚洲高清三级视频| 国产成人在线视频网址| 91久久国产最好的精华液| 欧美一区二区视频网站| 成人欧美一区二区三区白人 | 日本一区二区三区在线观看| 亚洲色欲色欲www| 久久爱另类一区二区小说| 成人av在线影院| 91精品国产乱| 亚洲三级在线看| 九色综合狠狠综合久久| 色综合久久中文综合久久牛| 日韩美女一区二区三区四区| 自拍av一区二区三区| 天天操天天综合网| 99视频精品全部免费在线| 91麻豆精品国产91久久久久久| 国产精品污污网站在线观看| 青青草国产精品97视觉盛宴 | 亚洲成人中文在线| 国产成人精品影视| 欧美一级理论片| 亚洲精品视频在线观看网站| 国内精品在线播放| 欧美精品日日鲁夜夜添| 亚洲精品五月天| 97精品久久久午夜一区二区三区 | 91高清视频在线| 国产日韩欧美一区二区三区乱码| 婷婷夜色潮精品综合在线| 99re成人精品视频| 国产精品久久久久久久久图文区 | 成人av影院在线| 欧美成人精品二区三区99精品| 依依成人综合视频| 色综合天天综合在线视频| 国产欧美日韩在线看| 国产在线一区二区综合免费视频| 91麻豆精品国产| 婷婷开心激情综合| 欧美日韩精品一区二区在线播放| 亚洲欧美一区二区三区国产精品| 国产成a人亚洲精品| 国产日韩欧美高清| 成人午夜视频在线观看| 久久久久久久久久久99999| 国内一区二区在线| 久久精品综合网| 不卡高清视频专区| 中文字幕一区免费在线观看| 91在线视频观看| 亚洲日本护士毛茸茸| 91亚洲精品一区二区乱码| 中文字幕在线不卡视频| 91蜜桃视频在线| 一区二区三区免费网站| 欧美午夜精品久久久久久孕妇| 丝袜美腿一区二区三区| 欧美日韩小视频| 青青草国产精品97视觉盛宴| 精品成人一区二区三区四区| 国内精品写真在线观看| 国产欧美一区二区三区网站| 91在线国产观看| 午夜视频在线观看一区二区| 91精品国产综合久久久久久漫画| 久久精品国产亚洲一区二区三区| 久久久久亚洲综合| 99久久99久久精品国产片果冻| 亚洲精品乱码久久久久久黑人| 欧美日韩视频第一区| 美女视频黄 久久| 国产精品女主播av| 欧美羞羞免费网站| 精品一区二区在线观看| 国产精品久久久一区麻豆最新章节| 色婷婷综合久久| 免费三级欧美电影| 国产调教视频一区| 欧美在线观看你懂的| 久久99国产精品麻豆| 亚洲手机成人高清视频| 日韩一区二区精品葵司在线| 成人免费av网站| 奇米一区二区三区| 亚洲天堂精品在线观看| 欧美本精品男人aⅴ天堂| 色偷偷成人一区二区三区91| 精品亚洲成a人| 亚洲国产日日夜夜| 精品国产亚洲在线| 欧美视频在线一区二区三区| 成人自拍视频在线观看| 日韩av中文字幕一区二区| 中文字幕在线免费不卡| 精品国产制服丝袜高跟| 欧美精三区欧美精三区| 色呦呦一区二区三区| 国产一区二区三区免费观看| 天堂在线亚洲视频| 亚洲精品日日夜夜| 中文字幕av一区二区三区免费看| 91精品国产手机| 一本一道波多野结衣一区二区| 国产真实精品久久二三区| 亚洲国产一二三| 亚洲欧美另类图片小说| 国产精品伦理在线| 久久精品视频免费| 久久综合久久久久88| 日韩欧美区一区二| 欧美区在线观看| 欧美巨大另类极品videosbest| 91小视频免费观看| 成人中文字幕合集| 国产成人精品影视| 顶级嫩模精品视频在线看| 国产一区二区三区免费播放 | 国产高清精品网站| 精品一区二区三区在线播放| 丝袜美腿亚洲综合| 日本不卡视频在线| 久久国产精品99精品国产| 日韩av在线免费观看不卡| 日日噜噜夜夜狠狠视频欧美人| 偷偷要91色婷婷| 另类小说综合欧美亚洲| 捆绑紧缚一区二区三区视频| 麻豆国产精品视频| 国产精品综合一区二区三区| 国产一区二区三区免费在线观看| 国产美女精品人人做人人爽| 国产盗摄一区二区| 成人免费观看男女羞羞视频| 色综合中文字幕国产 | 欧美激情在线观看视频免费| 中文字幕av一区二区三区免费看| 国产精品视频一区二区三区不卡| 国产精品久久久久久久久晋中 | 国产精品69毛片高清亚洲| 高清av一区二区| 色综合久久88色综合天天免费| 在线观看日产精品| 日韩欧美国产1| 中文字幕欧美区| 亚洲一区二区成人在线观看| 日韩av电影天堂| 极品少妇xxxx精品少妇偷拍| 高清成人在线观看| 91国产免费观看| 2021国产精品久久精品| 国产精品国产三级国产普通话三级| 一区二区高清视频在线观看| 日韩av中文字幕一区二区| 国产成人午夜视频| 欧洲日韩一区二区三区| 日韩欧美在线影院| 亚洲美女少妇撒尿| 久久99国产精品麻豆| 色综合久久精品| 久久日韩粉嫩一区二区三区| 亚洲女同一区二区| 裸体一区二区三区| 一本到不卡精品视频在线观看 | 中文字幕免费不卡| 午夜久久久影院| 国产69精品久久久久毛片| 欧美性欧美巨大黑白大战| 国产亚洲欧洲997久久综合| 亚洲午夜免费视频| 成人综合在线网站| 欧美v日韩v国产v|