majorto

tooogooo  时间:2021-02-05  阅读:()
CopyrightIBMCorporation2009TrademarksJ2MEPersonalInformationManagement(PIM)-AnOverviewPage1of7J2MEPersonalInformationManagement(PIM)-AnOverviewProvidingtheabilitytoaccessthenativepersonaldataonmobiledevicesSomaGhoshDecember07,2009ThePersonalInformationManagement(PIM)API,asdefinedbyJSR75,providesawaytoaccessthenativepersonaldataonthemobiledevices,beittheContacts,TasksorAppointments.
Inthisarticle,wewillhaveacloselookattheAPI,discussthedevelopment,securityanddeploymentconsiderationsofaPIMMIDletandcomparePIMwithanotherJ2MEAPI,theRecordManagementStore(RMS).
PersonalInformationManagement(PIM)inmobileenvironmentAsnewdevicesmaketothemarket,theavailabilityofAddressBook,CalendarandTasklistonmobiledevicesisabarenecessity.
TheJ2MEapplicationsalsofeeltheneedtohaveaccesstothesedata.
TheoptionalpackageJSR75PersonalInformationManagement(PIM)packageprovidesthiscapability.
Itnotonlyallowstheaccesstonativepersonalinformationwhichcomprisescontacts,appointmentsandtasks,alsotoinformationbasedonSIMcardsattachedtodevices,LocalandRemotePersonalInformationdatabases.
ThePIMpackagehascapabilitytoexportandimportofdatafromvCardandvCalendar,theInternetstandardformatsforAddressBookandCalendarrespectively.
Italsohasthesecurityfeaturestopreventunauthorizedclassesfromretrievingpersonalinformation.
Theotheroptionalpackage,JSR75FileConnectionprovidesawaytoaccessthenativefilesystemwhichisoutofscopeforourdiscussion.
TheJ2MEPIMpackageTheJavaPIMpackageisrepresentedbythejavax.
microedition.
pimpackage.
Thesignificantinterfacesdefinedbythispackageare:developerWorksibm.
com/developerWorks/J2MEPersonalInformationManagement(PIM)-AnOverviewPage2of71.
Contact–ThisInterfacerepresentsasinglecontactontheAddressBook.
2.
ContactList–ThisInterfacerepresentsAddressBookwhichisalistofContacts.
3.
Event–ThisInterfacerepresentsasingleCalendarEvent.
4.
EventList–ThisInterfacerepresentsalistofCalendarevents.
5.
ToDo–ThisInterfacerepresentsasingleTaskintheTaskList.
6.
ToDoList–ThisInterfacerepresentstheTasklist.
Themajorclassdefinedbythispackageis:PIM–ThePIMclassdefinesmethodsthatcancreateanindexofallexistingLists,openandeditthoselistsaswellasimportandexportfromInternetstandardformatsforContactandCalendar,thevCardandvCalendar.
ContactandContactListAContactrepresentsasingleentryintheAddressBook.
ThemajorfieldsinaContactareName,Address,Email,Birthday,PhotoandTelephone.
Inordertoensureportabilityacrossplatforms,itisadvisabletousethemethodisSupportedField()providedbySuperInterfacePIMList.
Listing1,belowshowshowaContactcanbeaddedtoAddressBook:Listing1.
AddContacttoAddressBookContactListaddressBook=null;try{addressBook=(ContactList)PIM.
getInstance().
openPIMList(PIM.
CONTACT_LIST,PIM.
READ_WRITE);}catch(PIMExceptione){//ExitApplication}ContactsingleContact=addressBook.
createContact();String[]name=newString[addressBook.
stringArraySize(Contact.
NAME)];if(addressBook.
isSupportedField(Contact.
NAME_FORMATTED)singleContact.
addString(Contact.
NAME_FORMATTED,PIMItem.
ATTR_NONE,"Mrs.
JaneDoe");ThecreateContact()methodcreatesatemporaryemptyContact.
Acommit()callmakestheContactdatapersistent.
Itisadvisabletoclosethelistsbyinvokingtheclose()methodafternecessaryoperationshavebeenperformed.
try{singleContact.
commit();}catch(PIMExceptione){//Exceptionoccured}try{//OthercleanuptasksaddressBook.
close();}catch(PIMExceptione){}ibm.
com/developerWorks/developerWorksJ2MEPersonalInformationManagement(PIM)-AnOverviewPage3of7EventandEventListAnEventrepresentsasingleentryintheEventdatabase,forexample;calendaronthemobiledevice.
ThecriticalfieldsareLocation,Summary,Startdate,EndDateandAlarmnotification.
Listing2showshowanEventcanbeaddedtotheEventdatabase.
Listing2.
AddanEventEventListeventList=null;try{eventList=(EventList)PIM.
getInstance().
openPIMList(PIM.
EVENT_LIST,PIM.
READ_WRITE);}catch(PIMExceptione){return;}EventsingleEvent=eventList.
createEvent();if(eventList.
isSupportedField(Event.
SUMMARY))singleEvent.
addString(Event.
SUMMARY,PIMItem.
ATTR_NONE,"JavaTraining");if(eventList.
isSupportedField(Event.
START))singleEvent.
addDate(Event.
START,PIMItem.
ATTR_NONE,aDate.
getTime());if(eventList.
isSupportedField(Event.
END))singleEvent.
addDate(Event.
END,PIMItem.
ATTR_NONE,aDate.
getTime());try{singleEvent.
commit();}catch(PIMExceptione){//Anerroroccured}try{eventList.
close();}catch(PIMExceptione){}ToDoandToDoListTheToDointerfacerepresentsasingletaskontheTaskdatabaseonthemobiledevice.
TheimportantfieldsareNoteorSummary,Priority,CompletionDate,DueDateandwhethercompleted.
Listing3showshowaToDocanbepersistentlyaddedtothedatabase.
Listing3.
AddaTaskToDoListtasks=null;try{tasks=(ToDoList)PIM.
getInstance().
openPIMList(PIM.
TODO_LIST,PIM.
READ_WRITE);}catch(PIMExceptione){//Anerroroccurredreturn;}ToDosingleTask=tasks.
createToDo();if(tasks.
isSupportedField(Event.
SUMMARY))singleTask.
addString(ToDo.
SUMMARY,PIMItem.
ATTR_NONE,"ShoppingforHalloween");if(tasks.
isSupportedField(Event.
DUE))singleTask.
addDate(ToDo.
DUE,PIMItem.
ATTR_NONE,newDate().
getTime());try{singleTask.
commit();}catch(PIMExceptione){//Anerroroccured}try{tasks.
close();}catch(PIMExceptione){developerWorksibm.
com/developerWorks/J2MEPersonalInformationManagement(PIM)-AnOverviewPage4of7}HowPIMdiffersfromRMSBeforegoingfurtheronthisdiscussion,letusreviewtheconceptofRecordManagementStore(RMS),anotherkeyfunctionalitybyJ2ME.
RMSallowsJ2MEapplicationstopersistentlystoredatalocally.
ThecomponentsofRMSareasfollows:Records–UnliketheDatabasesystemswhereeachrecordhasoneormorefields,aRecordinRMSisanindividualdatafield.
Itdoesnothaveapre-defineddatatypeorsizeandcancontainanydata.
RecordStore–ARecordStoreisacollectionofRecordsandisaccessiblefromJ2MEapplicationsbyname.
ThisishowPIMdiffersfromRMSwhilebothareresponsibleforstoringpersistentdataonthedevice.
1.
PIMstoresandretrievesdatatoandfromdefinedentitiesliketheAddressBook,CalendarandTaskList.
RMS,ontheotherhand,storesdatatoandretrievesdatafromageneraldatabase.
AsingleentityinPIMisaContact,CalendarentryoraTaskwhileinRMS,it'sabytearray.
2.
PIMisnotrestrictedtothelocaldevice.
ItcanaccessdatafromanattachedSIMoranotherremotedevice.
RMSonlyaccessesdatatoandfromlocaldevice.
3.
PIMcanexportandimportfromexternalsourceslikevCalendarorvContact.
RMSdoesnothaveanyExportorImportcapabilities.
4.
TheinterpretationofdatainPIMismoreflexiblecomparedtoRMS.
Say,aContact,definedinastandardformat,canalwaysbeinterpretedbyanotherJ2MEapplicationwithease.
ArecordinRMSisabytearrayandotherJ2MEapplicationswillneedtohaveinformationonhowtointerpret.
Anexample–AddacontactInthissection,wewilldiscussamethodmentionedasaddContact()onhowtoaddacontacttotheAddressBook.
ThismethodasinCode-4canbeinvokedinaseparatethreadwhenausercommandissubmittedontheform.
ThismethodaccessesdataenteredthroughUITextfields.
Listing4.
addContact()method//Importimportjavax.
microedition.
lcdui.
*;importjavax.
microedition.
midlet.
*;importjavax.
microedition.
pim.
*;//TextinputTextFieldnameField;TextFieldphoneField;…publicvoidaddContact(){ibm.
com/developerWorks/developerWorksJ2MEPersonalInformationManagement(PIM)-AnOverviewPage5of7ContactListcontacts=null;try{contacts=(ContactList)PIM.
getInstance().
openPIMList(PIM.
CONTACT_LIST,PIM.
READ_WRITE);}catch(PIMExceptione){//Anerroroccurrede.
printStackTrace();}Contactcontact=contacts.
createContact();String[]name=newString[contacts.
stringArraySize(Contact.
NAME)];if(contacts.
isSupportedArrayElement(Contact.
NAME,Contact.
NAME_GIVEN))name[Contact.
NAME_GIVEN]=nameField.
getString();if(contacts.
isSupportedField(Contact.
TEL))contact.
addString(Contact.
TEL,Contact.
ATTR_HOME,phoneField.
toString());try{contact.
commit();}catch(Exceptione){}}RuntimeandsecurityconsiderationsThePIMMIDletshouldberuninaconfigurationthatsupportsPIMi.
e.
JSR75.
WeselectedthebelowsettingsonSun'sWirelessToolkit2.
5byclickingSettingsandthenAPISelection.
ThesameappliestoselectionofmobiledevicesforPIMMIDlettorun.
developerWorksibm.
com/developerWorks/J2MEPersonalInformationManagement(PIM)-AnOverviewPage6of7Figure1.
PIMMIDletRuntimeAPISelectionTheMIDletwillrequireadditionalpermissionswhileattemptingtoreadandwritetheContacts,CalendarorTaskLists.
ThiscanbeaccomplishedbyclickingSettingsandselectingPermissionsfromtheWirelesstoolkit.
AlltheReadandWritepermissionsforContactList,EventListandTodoListhavebeenprovided.
ibm.
com/developerWorks/developerWorksJ2MEPersonalInformationManagement(PIM)-AnOverviewPage7of7Figure2.
PIMMIDletSecurityconsiderationsConclusionInthisarticlewediscussedaboutanotherimportantfunctionalityinJ2MEcalledPersonalInformationManagement(PIM)thatallowsaccesstothenativedataonthemobiledeviceintheformofContact,TaskandEvent.
ItalsodrawsacomparisonwithRMS,anotherfunctionalitythatdealswithdevicedata.
Withtheinherentexportandimportcapabilities,itisnowpossibletosyncupJ2MEapplicationswithvCardandvCalendar,theinternetstandardformatforContactandCalendarrespectively.
Weconcludedwiththesecurityanddeploymentrequirementsatruntime.
CopyrightIBMCorporation2009(www.
ibm.
com/legal/copytrade.
shtml)Trademarks(www.
ibm.
com/developerworks/ibm/trademarks/)

特网云57元,香港云主机 1核 1G 10M宽带1G(防御)

特网云官網特网云服务器在硬件级别上实现云主机之间的完全隔离;采用高端服务器进行部署,同时采用集中的管理与监控,确保业务稳定可靠,搭建纯SSD架构的高性能企业级云服务器,同时采用Intel Haswell CPU、高频DDR4内存、高速Sas3 SSD闪存作为底层硬件配置,分钟级响应速度,特网云采用自带硬防节点,部分节点享免费20G防御,可实现300G防御峰值,有效防御DDoS、CC等恶意攻击,保障...

ZJI:韩国BGP+CN2线路服务器,国内三网访问速度优秀,8折优惠码每月实付440元起

zji怎么样?zji最近新上韩国BGP+CN2线路服务器,国内三网访问速度优秀,适用8折优惠码zji,优惠后韩国服务器最低每月440元起。zji主机支持安装Linux或者Windows操作系统,会员中心集成电源管理功能,8折优惠码为终身折扣,续费同价,全场适用。ZJI是原Wordpress圈知名主机商:维翔主机,成立于2011年,2018年9月启用新域名ZJI,提供中国香港、台湾、日本、美国独立服...

美国云服务器 1核 1G 30M 50元/季 兆赫云

【双十二】兆赫云:全场vps季付六折优惠,低至50元/季,1H/1G/30M/20G数据盘/500G流量/洛杉矶联通9929商家简介:兆赫云是一家国人商家,成立2020年,主要业务是美西洛杉矶联通9929线路VPS,提供虚拟主机、VPS和独立服务器。VPS采用KVM虚拟架构,线路优质,延迟低,稳定性强。是不是觉得黑五折扣力度不够大?还在犹豫徘徊中?这次为了提前庆祝双十二,特价推出全场季付六折优惠。...

tooogooo为你推荐
云爆发养兵千日用兵千日这个说法对不对商标注册流程及费用商标注册流程及费用?网站检测请问论文检测网站好的有那些?5xoy.comhttp www.05eee.comm.kan84.net经常使用http://www.feikan.cc看电影的进来帮我下啊www.bbb551.com广州欢乐在线551要收费吗?99nets.com99nets网游模拟娱乐社区怎么打不开了?????????谁能告诉我 ???、www.15job.com广州天河区的南方人才市场henhenlu.com谁有大片地址呀 麻烦告诉我 谢谢啦 O会给你打满分的dpscycle寻求LR 高输出宏
广州主机租用 免费域名解析 cn域名个人注册 大硬盘 adman 香港新世界电讯 godaddy优惠券 天猫双十一抢红包 私有云存储 个人免费空间 上海域名 上海服务器 备案空间 免费网络 hdroad SmartAXMT800 register.com 架设代理服务器 cx域名 跟踪路由 更多