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

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

?? listing 12-1.java

?? 關于j2me的midlet事例源碼, 能幫助你晉級!
?? 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一区二区三区免费野_久草精品视频
久久精品网站免费观看| 亚洲午夜久久久久久久久电影院| 国产视频一区二区在线观看| 亚洲日本在线观看| 久久精品av麻豆的观看方式| 99热99精品| 精品国产网站在线观看| 亚洲国产一区二区视频| 成人少妇影院yyyy| 欧美一区二区三区免费大片 | 国产自产2019最新不卡| 欧美中文字幕不卡| 国产日产欧美一区二区视频| 午夜影院在线观看欧美| 91麻豆文化传媒在线观看| 精品奇米国产一区二区三区| 亚洲国产一区二区视频| 99久久久国产精品免费蜜臀| 久久午夜电影网| 久色婷婷小香蕉久久| 在线免费亚洲电影| 亚洲免费伊人电影| 波多野结衣在线一区| 久久久久久久综合色一本| 麻豆成人免费电影| 91超碰这里只有精品国产| 亚洲一区二区免费视频| 欧美在线啊v一区| 亚洲综合激情网| 色香蕉久久蜜桃| 亚洲啪啪综合av一区二区三区| 国产99久久久久久免费看农村| 久久综合九色综合97婷婷女人| 久久99最新地址| 精品国产青草久久久久福利| 国产综合久久久久影院| 久久婷婷一区二区三区| 国产在线视频不卡二| 久久精品视频免费观看| 成人在线视频一区二区| 国产精品视频一二三| aaa亚洲精品一二三区| 成人欧美一区二区三区在线播放| 97精品久久久午夜一区二区三区| 国产精品成人在线观看| 一本色道久久综合亚洲aⅴ蜜桃 | 91麻豆免费观看| 国产精品免费视频一区| 色综合中文综合网| 91浏览器入口在线观看| 亚洲一区二区在线免费观看视频| 欧美色视频在线| 日韩高清不卡一区二区| 精品国产一区二区亚洲人成毛片| 激情五月婷婷综合网| 欧美经典三级视频一区二区三区| proumb性欧美在线观看| 亚洲在线视频网站| 日韩一区二区不卡| 国产成人在线视频免费播放| 综合色天天鬼久久鬼色| 欧美日韩一级二级三级| 精品午夜久久福利影院| 国产精品不卡一区| 欧美精品99久久久**| 激情图区综合网| 日韩一区在线免费观看| 日韩一区二区高清| 91免费在线看| 美女一区二区视频| 亚洲欧美中日韩| 欧美一区午夜视频在线观看| 国产成人免费在线视频| 图片区小说区区亚洲影院| 久久久久国产精品厨房| 在线观看国产日韩| 美女久久久精品| 曰韩精品一区二区| 精品国产成人在线影院 | 精品一区二区三区视频| 久久久久久久久久看片| 成人性视频免费网站| 亚洲丰满少妇videoshd| 国产日产欧产精品推荐色| 制服丝袜亚洲网站| 一本大道久久a久久精品综合| 九九精品视频在线看| 一区二区久久久久| 国产精品色哟哟| 日韩欧美一区在线| 欧洲精品一区二区| 成人白浆超碰人人人人| 免费久久99精品国产| 亚洲综合色在线| 国产精品区一区二区三区| 精品人在线二区三区| 欧美日韩国产高清一区二区三区| 成人免费av在线| 国产自产高清不卡| 久久精品国内一区二区三区| 亚洲国产精品久久久久秋霞影院 | 91久久精品一区二区| 国产精品一区在线观看乱码| 日韩av电影免费观看高清完整版在线观看| 国产精品国产三级国产普通话三级| 欧美一三区三区四区免费在线看| 欧洲亚洲国产日韩| 91丨九色丨尤物| 91免费国产视频网站| 成人午夜免费视频| 国产jizzjizz一区二区| 国产精品自拍网站| 国产一区二区三区免费播放| 蜜臀av在线播放一区二区三区 | 1024成人网| 成人免费在线视频| 亚洲蜜臀av乱码久久精品| 亚洲伦在线观看| 一区二区国产盗摄色噜噜| 亚洲激情五月婷婷| 亚洲最大成人综合| 亚洲福利一区二区| 日本伊人精品一区二区三区观看方式| 亚洲一区在线免费观看| 亚洲成a天堂v人片| 免费在线观看视频一区| 久久精品国产99国产| 国产乱码字幕精品高清av | 国产精品一品视频| 国产黄色精品网站| 成人性生交大片免费看中文网站| 99久久久无码国产精品| 91久久线看在观草草青青| 欧美性大战久久久久久久| 欧美肥大bbwbbw高潮| 精品剧情v国产在线观看在线| 久久影院电视剧免费观看| 国产午夜精品福利| 亚洲色图制服丝袜| 亚洲国产精品麻豆| 激情久久久久久久久久久久久久久久| 国产一区视频在线看| aa级大片欧美| 欧美三级午夜理伦三级中视频| 欧美精品粉嫩高潮一区二区| 日韩欧美三级在线| 国产精品久久久久久久午夜片| 亚洲欧美日韩成人高清在线一区| 亚洲制服欧美中文字幕中文字幕| 视频在线观看91| 国产九色sp调教91| 欧美色网站导航| 久久综合网色—综合色88| 中文字幕在线视频一区| 亚洲二区在线观看| 国产资源在线一区| 日本高清不卡一区| 久久毛片高清国产| 亚洲视频小说图片| 久久成人精品无人区| 94-欧美-setu| 精品欧美一区二区在线观看| 成人欧美一区二区三区| 看片的网站亚洲| 91丝袜呻吟高潮美腿白嫩在线观看| 69久久99精品久久久久婷婷| 国产欧美一区二区在线观看| 亚州成人在线电影| 91尤物视频在线观看| 精品国产精品网麻豆系列 | 日本乱人伦aⅴ精品| 精品噜噜噜噜久久久久久久久试看| 中文字幕亚洲一区二区av在线| 青青草国产成人av片免费| 成人教育av在线| 欧美一三区三区四区免费在线看| 国产精品乱码一区二三区小蝌蚪| 欧美色成人综合| 欧美一区二区免费视频| 亚洲精品国产视频| 成人福利电影精品一区二区在线观看 | 国产乱人伦偷精品视频免下载| 日本精品一级二级| 亚洲欧美日韩精品久久久久| 91在线免费看| 99久久精品免费看| 欧美精品一区在线观看| 五月婷婷久久综合| 99久久99久久综合| 精品奇米国产一区二区三区| 三级不卡在线观看| 欧美午夜不卡在线观看免费| 中文字幕一区二区三区四区不卡 | 欧美日韩在线电影| 亚洲欧美另类综合偷拍| 国产91露脸合集magnet| 久久综合色之久久综合| 韩国午夜理伦三级不卡影院| 欧美一区二区高清| 亚欧色一区w666天堂|