使用JAVA API进行黑莓应用程序开发

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

DEVELOPINGBLACKBERRYAPPLICATIONSUSINGJAVAAPI’SAGENDA•BlackBerryJavaDevelopment–Background–APIsandCapabilities•BlackBerryDeveloperTools–BlackBerryJDEPluginforEclipse–BlackBerryJDE–BlackBerrySimulators–OtherIDEs(e.g.NetBeans)–BlackBerryCodeSigning•ResourcesBLACKBERRYJAVADEVELOPMENT•Java®APIsfortheBlackBerry®solutionenableyoutodeveloprichclientapplicationsthatprovide–Customizableuserinterfaces–Localdatastorageonthedevice–Eventlisteningandsysteminterfaces–SecurewirelesstransportviaHTTP–NetworkcoverageandseamlessroamingsupportBLACKBERRYJAVADEVELOPMENT•AdvancedJavaAPIcapabilitiesinclude–IntegrationwithBlackBerryEmail,PIMandPhoneapplications–Always-onbackgroundthreadstolistenforpushdata–CommunicationwithBluetooth®-enabledperipherals–Location-basedservices–Richmultimediacapabilities–CryptographyandSecurityAPIsEVOLUTIONOFTHEBLACKBERRYSMARTPHONESOFTWAREEVOLUTIONOFTHEBLACKBERRYSMARTPHONESOFTWAREHANDHELDSOFTWAREVERSIONSBlackBerryJDEisforwardscompatiblewithhandheldsoftwareversionsTBD4.6PearlFlip8220(WiFi)TBD4.6Bold9000(GPS+WiFi)TBD4.7Storm95004.54.3Pearl8110(GPS),8120(WiFi)4.54.2.2Curve8300,8310(GPS),8320(WiFi)4.54.2.28820(GPS+WiFi)4.54.2.18800(GPS)4.2.1,4.54.2.0Pearl81004.2.1,4.54.18700(GPRS,EDGE)4.2.14.18707(GPRS,UMTS)4.2.14.17130gUpgradeableLaunchModelAGENDA•BlackBerryJavaDevelopment–Background–APIsandCapabilities•BlackBerryDeveloperTools–BlackBerryJDEPluginforEclipse–BlackBerryJDE–BlackBerrySimulators–OtherIDEs(e.g.NetBeans)–BlackBerryCodeSigning•ResourcesBLACKBERRYJAVA/JAVAME•BlackBerrysupportstwotypesofAPIs:–StandardJavaMicroEditionAPIs•IncludingMIDP,CLDC,andavarietyofJSRs–EnhancedJavaAPIsforBlackBerry•EnabletightintegrationwiththeuniquefeaturesofBlackBerrysmartphonesandapplications•Otherkeycapabilitiesinclude:–NetworkingandSecurePushServices–Richmultimediafeatures–Locationandmappingservices–DataaccessandPersistentstorage–MessagingSupport(Email,PIN,andSMS)–Integrationwithbuilt-inapplicationsAPIsANDCAPABILITIESNetworking–Multiplenetworktransportsareavailable:•BlackBerry®MobileDataSystemforintranetaccess•DirectTCPConnectivity•CarrierWAPGateway•BlackBerry®InternetService–Multipleconnectiontypes•HTTP&PersistentSocketconnectionsURL=“”;//AppendappropriateparametersattheendoftheURLto//forceconnectionviaaparticulartransportHttpConnectionhttp=(HttpConnection)Connector.open(URL);DataOutputStream.write(myData.getBytes());//WriteoutdataDataIpoutStreamin=http.openInputStream();//ReadinresponseinthttpStatus=http.getResponseCode();//ReadHTTPStatusURL=“”;//AppendappropriateparametersattheendoftheURLto//forceconnectionviaaparticulartransportHttpConnectionhttp=(HttpConnection)Connector.open(URL);DataOutputStream.write(myData.getBytes());//WriteoutdataDataIpoutStreamin=http.openInputStream();//ReadinresponseinthttpStatus=http.getResponseCode();//ReadHTTPStatusAPIsANDCAPABILITIESNetworkingTips–Understandthegatewayyouareusing•ManagingWirelessDataTransportwhitepapersonBlackBerryDeveloperZone&JavaDocs–UsetheCoverageInfoAPIstartinginv4.2.0•Checkforcoveragepriortomakingconnection•Uselistenerstoreceivenotificationsaboutchangesincoverage–AlwaysperformInput/OutputoperationsonaseparatethreadinsteadoftheEventthreadandcloseconnectionsproperly•seeKnowledgeBasearticleDB-00530–ForconnectionsusingDirectTCP,thereisamaximumof5simultaneousconnections•SeeKnowledgeBasearticleDB-00480Networking–“Push”–Referstoaserver-initiatedconnectionwhereaserver-sideapplicationsendsdatatoaclientapplicationproactively•HTTPPOSTconnectiontoMDS,writeoutthecontentsofthepush•Canbewritteninanyserverprogramminglanguage,provideditsupportsHTTPtransport(Java/JavaEE,.NET/C#,etc.)–Pushapplicationiswritteninsamewayasbrowserpushapplicationandcanleveragesamefeatures•AddressdestinationuserviaemailaddressordevicePIN•ContentistypicallyXMLorplaintext,ratherthanHTML–ConsiderBlackBerrypushfeatures:•BlackBerryPushvs.PAPPush•ReliablePush,Delivery-BeforetimestampandotherfeaturesavailableinBlackBerryEnterpriseServerv4.0+APIsANDCAPABILITIESAPIsANDCAPABILITIESClientandserversamplecodeforpush:ClientApp:ClasshttpListenextendsThreadrun(){URL=“http://:5500”;//Arbitrarylocalportnotify=(StreamConnectionNotifier)Connector.open(URL);StreamConnectionstream=notify.acceptAndOpen();…}ServerApp:URL=“=amy@myCo.net&PORT=5500”;myHttpConnection.setRequestMethod(“POST”);out=myHttpConnection.getOutputStream();out.write(myData);WirelessBlackBerryEnterpriseServerwithMDSWeb/AppServerJavaAppHTTPPOSTUserInterface–UserInterfaceAPIsallowyouto:•Addscreenobjectstothedisplay•Addfieldsandmenustothescreen•AddakeylistenertothescreenandusenavigationAPI’s–Actonusertrackball/key/touchevents–Variousscreensandfieldtypesareavailable:•MainScreen,PopupScreen,Dialog•EditField,ListField,RadioButtonField,etc.–RefertotheBlackBerryapplicationsonthedevicetoseewhatyoucando!APIsANDCAPABILITIESUserInterface-Tips–Eachscreencanbeitsownclass,responsibleforimplementingitsownmenuitems,fields

1 / 42
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功