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