亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成人美女视频在线观看18| 免费一级欧美片在线观看| 亚洲成a人v欧美综合天堂| 免费高清在线一区| gogo大胆日本视频一区| 3atv在线一区二区三区| 国产精品美女www爽爽爽| 偷拍自拍另类欧美| 不卡一卡二卡三乱码免费网站| 欧美性xxxxx极品少妇| 国产清纯白嫩初高生在线观看91 | 91亚洲精品一区二区乱码| 91精品国模一区二区三区| 综合久久给合久久狠狠狠97色| 久久99九九99精品| 在线免费不卡视频| 久久精品欧美一区二区三区麻豆| 亚洲午夜视频在线| 成人av网站在线| 精品88久久久久88久久久 | 欧美国产精品中文字幕| 99国产麻豆精品| 国产亚洲成aⅴ人片在线观看| 日韩电影网1区2区| 在线免费不卡视频| 亚洲欧美日韩电影| eeuss鲁片一区二区三区在线看| 2024国产精品| 麻豆免费看一区二区三区| 欧美剧在线免费观看网站| 一区二区三区中文免费| av色综合久久天堂av综合| 国产情人综合久久777777| 国产乱一区二区| 久久久噜噜噜久噜久久综合| 蜜臀久久99精品久久久久宅男| 欧美日韩在线不卡| 亚洲第一激情av| 欧美性一级生活| 亚洲一区二区高清| 欧美揉bbbbb揉bbbbb| 亚洲国产欧美另类丝袜| 欧美日韩在线播放三区| 亚洲成av人片在线| 在线播放中文字幕一区| 奇米精品一区二区三区在线观看 | 色哟哟欧美精品| 亚洲综合激情小说| 成人av在线网| 中文字幕欧美区| 国产99一区视频免费| 精品成人免费观看| 国产在线视视频有精品| 久久精品免视看| 97精品久久久久中文字幕| 亚洲女爱视频在线| 欧美日韩一区二区三区免费看| 日韩专区中文字幕一区二区| 久久噜噜亚洲综合| 99vv1com这只有精品| 亚洲午夜三级在线| 精品国精品国产尤物美女| 成人午夜av电影| 亚洲精品v日韩精品| 51久久夜色精品国产麻豆| 久久99精品国产.久久久久| 久久久国产综合精品女国产盗摄| 成人黄色软件下载| 亚洲综合无码一区二区| 日韩欧美精品三级| 成人sese在线| 日本不卡的三区四区五区| 久久久国产一区二区三区四区小说| 91丝袜美女网| 久久精品二区亚洲w码| 国产精品伦一区| 欧美一区午夜精品| 国产精品私人自拍| 一区二区三区在线免费播放| 亚洲成在人线在线播放| 精品国产亚洲一区二区三区在线观看| 国产乱妇无码大片在线观看| 一区二区三区精品视频在线| 亚洲精品一区二区三区在线观看| 久久久久99精品一区| 91免费版在线| 韩国视频一区二区| 亚洲一区成人在线| 日本一区二区免费在线观看视频| 欧美日韩性生活| 成+人+亚洲+综合天堂| 日韩**一区毛片| 亚洲蜜臀av乱码久久精品 | av电影天堂一区二区在线观看| 婷婷开心久久网| 亚洲欧美日韩在线| 久久久久久久久久美女| 欧美肥妇bbw| 欧洲精品视频在线观看| 懂色av中文字幕一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲女同ⅹxx女同tv| 欧美国产乱子伦| 久久先锋影音av鲁色资源网| 欧美一区二区三区免费大片 | 国产超碰在线一区| 麻豆精品视频在线观看免费| 亚洲第一综合色| 亚洲五码中文字幕| 一区二区三区在线不卡| 国产精品久久久久三级| 国产欧美一区二区精品性| 精品久久久久久综合日本欧美 | 精品久久久影院| 日韩区在线观看| 亚洲夂夂婷婷色拍ww47| 国产精品全国免费观看高清| 久久久久综合网| 2020日本不卡一区二区视频| 欧美videossexotv100| 日韩一区二区免费电影| 欧美一区国产二区| 制服丝袜日韩国产| 69久久夜色精品国产69蝌蚪网| 欧美日本一区二区三区| 欧美日韩一区视频| 欧美三级韩国三级日本一级| 欧美久久久久免费| 欧美精品tushy高清| 欧美一区二区三区免费观看视频 | 99精品久久久久久| 成人av网站大全| 在线精品视频一区二区| 在线免费观看视频一区| 欧美精品1区2区3区| 欧美一区二区大片| 欧美成人三级在线| 久久久噜噜噜久久中文字幕色伊伊| 欧美国产精品久久| 亚洲天堂免费在线观看视频| 亚洲一区二区三区激情| 亚洲va韩国va欧美va| 婷婷开心久久网| 国产精品伊人色| 色综合激情五月| 88在线观看91蜜桃国自产| 欧美va亚洲va香蕉在线| 国产午夜亚洲精品羞羞网站| 亚洲精品免费电影| 日本不卡在线视频| 国产精品系列在线播放| 91老司机福利 在线| 欧美一区二区视频网站| 国产欧美一区二区精品久导航| 一区二区三区中文免费| 久久se这里有精品| av成人老司机| 日韩无一区二区| 综合av第一页| 精品中文av资源站在线观看| 99久久免费精品高清特色大片| 欧美久久婷婷综合色| 国产欧美日韩另类一区| 亚洲国产日日夜夜| 久久不见久久见免费视频7 | 亚洲美女屁股眼交3| 青青草一区二区三区| 不卡欧美aaaaa| 欧美美女黄视频| 国产精品久久久久婷婷二区次| 美国一区二区三区在线播放| 91老师国产黑色丝袜在线| 精品国产一区二区在线观看| 亚洲一区二区三区中文字幕在线| 国产精品91一区二区| 欧美高清hd18日本| 亚洲人成精品久久久久久| 国产自产高清不卡| 欧美日韩高清影院| 中文字幕一区二区三区四区不卡| 久久av中文字幕片| 精品视频一区二区三区免费| 亚洲欧洲日韩在线| 国产成人免费视| 精品国产伦一区二区三区观看体验| 一区二区三区四区在线播放| 成人av一区二区三区| 久久久国产午夜精品| 麻豆一区二区三| 制服丝袜中文字幕一区| 亚洲高清免费观看高清完整版在线观看| 99久久亚洲一区二区三区青草| 亚洲精品在线三区| 蜜桃av一区二区三区| 欧美挠脚心视频网站| 亚洲一区二区在线免费观看视频| 99久久国产综合色|国产精品| 亚洲国产激情av| 国产成人在线看| 国产日韩高清在线|