Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Anleitung zur Fehlerbehebung

Stöbern Sie online oder laden Sie Anleitung zur Fehlerbehebung nach Software Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE herunter. Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Troubleshooting guide Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 286
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen

Inhaltsverzeichnis

Seite 1 - Environment

BlackBerry Java Development EnvironmentVersion 4.2.0Development Guide

Seite 2

Use the BlackBerry Maps application ... 201Locating Black

Seite 3

100BlackBerry Java Development Environment Development Guide/*** Determine if this smart card can display its settings.*/protected boolean isDisplaySe

Seite 4

1015: Using smart cardsActivate libMain() on startup Create a session for the smart card driverCode sample: Creating a smart card sessionExample: MyCr

Seite 5 - Contents

102BlackBerry Java Development Environment Development Guide*/package com.rim.samples.device.smartcard;import net.rim.device.api.crypto.*;import net.r

Seite 6

1035: Using smart cards* The method returns Integer.MAX_VALUE if an infinite number of attempts are allowed. */protected int getMaxLoginAttemptsImpl()

Seite 7

104BlackBerry Java Development Environment Development Guide // Using friendly display namereturn new SmartCardID( idLong , ID_STRING, getSmart

Seite 8

1055: Using smart cards} stepProgressDialog( 1 );privateKey = new RSAPrivateKey( cryptoSystem, new MyCryptoTokenData( smartCardID, ID_PKI )

Seite 9

106BlackBerry Java Development Environment Development Guideif ( ( input.length < inputOffset + modulusLength ) || ( output.length < outputOffse

Seite 10

1075: Using smart cardsDetermine if the token supports the chosen operation using the current crypto system.> Create a method that returns a Boolea

Seite 11

108BlackBerry Java Development Environment Development GuideCode sample: Creating a CryptoToken for private key RSA operationsExample: MyRSACryptoToke

Seite 12

1095: Using smart cards/** * Determine if this token supports the chosen operation using the provided system.* * @param cryptoSystem Crypto System to

Seite 13 - Creating UIs

Debugging applications... 2

Seite 14 - UI components

110BlackBerry Java Development Environment Development Guide/*** Perform a raw RSA signing.* * @param cryptoSystem Cypto system associated with the to

Seite 15 - Create a screen

1115: Using smart cardsreturn;}} throw new RuntimeException();} catch ( SmartCardSessionClosedException e ) {throw new CryptoTo

Seite 16

112BlackBerry Java Development Environment Development GuideStore the private key file locationCode sample: Storing the location of a private key file

Seite 17 - Creating custom UI components

1135: Using smart cards*/private SmartCardID _id; /*** Location of the private key file on the smart card.*/private byte _file;/*** Constructs a ne

Seite 18 - Create a custom field

114BlackBerry Java Development Environment Development Guide

Seite 19 - 1: Creating UIs

6 Managing memoryInvoking a garbage collection operationSee the Garbage Collection in the BlackBerry Java Development Environment white paper and the

Seite 20

116BlackBerry Java Development Environment Development GuideUse the LMMFree persistent objectsA low number of persistent object handles exist on a Bla

Seite 21

7 Creating connectionsFetching data using HTTP or TCP socketsJava™ applications for BlackBerry® devices can use standard HTTP, HTTPS, and TCP socket p

Seite 22

118BlackBerry Java Development Environment Development GuideUsing the wireless service providers Internet gatewayJava™ applications for BlackBerry® de

Seite 23

1197: Creating connectionsExample: HTTPFetch.java/** * HTTPFetch.java * Copyright (C) 2001-2005 Research In Motion Limited. All rights reserved. */pac

Seite 24

Distribute applications ...267Di

Seite 25

120BlackBerry Java Development Environment Development Guide * the shared data in a synchronized block, but produces less overhead. */

Seite 26 - Create custom context menus

1217: Creating connections InputStream input = s.openInputStream(); // Extract data in 256 byte chunks.

Seite 27

122BlackBerry Java Development Environment Development Guide int i = 0; for (i = HTTP_PROTOCOL.length - 1; i >= 0; --i) {

Seite 28

1237: Creating connectionsCode sample: Using HTTP authentication to connect to a protected Internet resourceExample: Using HTTP authentication to conn

Seite 29 - Create custom layout managers

124BlackBerry Java Development Environment Development Guide{int status = httpConn.getResponseCode();switch (status){case (HttpConnection.HTTP_OK)://C

Seite 30 - Example: DiagonalManager.java

1257: Creating connectionskeepGoing = false;}break;default://The connection failed for some other reason.//Handle failed connection.keepGoing = false;

Seite 31

126BlackBerry Java Development Environment Development Guide• Applications that use socket connections typically require significantly more bandwidth

Seite 32 - return index;

1277: Creating connectionsTask StepsBefore opening a datagram connection, verify that the BlackBerry® device is ina wireless coverage area.>Use the

Seite 33 - Create custom lists

128BlackBerry Java Development Environment Development GuideUsing port connectionsUsing a serial or USB connection, BlackBerry device ® applications c

Seite 34

1297: Creating connectionsCode sample: Listening for data on the serial port and rendering the data when it arrivesExample: BluetoothSerialPortDemo.ja

Seite 35

1 Creating UIsElements of a BlackBerry device UIScreensThe main structure for a BlackBerry® device UI is the Screen object. A BlackBerry device applic

Seite 36 - Register a menu item

130BlackBerry Java Development Environment Development Guide */package com.rim.samples.docs.bluetoothserialportdemo;import java.io.*;import javax.mic

Seite 37 - Example: DemoAppMenuItem.java

1317: Creating connections public void close() { closePort(); super.close(); } } public s

Seite 38 - Arrange UI components

132BlackBerry Java Development Environment Development Guide } } _bluetoothConnection = null; _din = null; _dou

Seite 39

1337: Creating connections try { int type, offset, count; String value; _dout.writeInt(JUST_OP

Seite 40 - Respond to UI events

134BlackBerry Java Development Environment Development Guide }); } private void remove(final int offset, final int count) { in

Seite 41

8 Creating notificationsTypes of notification eventsThe notification API (net.rim.device.api.notification) lets you add custom events for your applica

Seite 42

136BlackBerry Java Development Environment Development GuideAdd a new event sourceRegister the event source when the BlackBerry device startsTo regist

Seite 43 - Manage drawing areas

1378: Creating notificationsCode sample: Example: NotificationsDemo.java/** * NotificationsDemo.java * Copyright (C) 2001-2005 Research In Motion Limi

Seite 44

138BlackBerry Java Development Environment Development Guide } public NotificationsDemo() { MainScreen mainScreen = new NotificationsM

Seite 45 - Using graphics and multimedia

1398: Creating notifications } public void deferredEventWasSuperseded(long sourceID, long eventID, Object eventRefere

Seite 46 - Use encoded images

14BlackBerry Java Development Environment Development GuideTypes of screensHow the JVM manages screensThe JVM maintains Screen objects in a display st

Seite 47 - Example: ImageDemo.java

140BlackBerry Java Development Environment Development GuideRespond to deferred eventsTask StepsProvide a custom UI notification.> Implement the No

Seite 48 - Drawing and rendering images

1418: Creating notificationsCancel eventsCustomize system notifications for immediate eventsTask StepsCancel an immediate event. >Invoke cancelImme

Seite 49

142BlackBerry Java Development Environment Development GuideDefine a notification. > Implement startNotification().public void startNotification(lo

Seite 50 - Example: DrawDemo.java

1438: Creating notificationsCode sample: Creating a custom notificationExample: ConsequenceDemo.java/** * ConsequenceDemo.java * Copyright (C) 2001-20

Seite 51 - Using audio

144BlackBerry Java Development Environment Development Guide public void startNotification(long consequenceID, long sourceID, long eventID,

Seite 52 - Example: Sequence of tones

1458: Creating notifications } }}

Seite 53

146BlackBerry Java Development Environment Development Guide

Seite 54 - Play media

9 Managing applicationsApplication managerThe JVM on BlackBerry® devices includes an application manager that functions as the central dispatcher of o

Seite 55 - Using rich media

148BlackBerry Java Development Environment Development GuideRegister applications when the BlackBerry device startsTo register the event source when t

Seite 56 - Example: MediaSample.java

1499: Managing applicationsListen for changes to IT policiesCode example: Listening for changes to IT policiesExample: ITPolicyDemo.java/** * ITPolicy

Seite 57 - Listen for rich media events

151: Creating UIsCreate a screen> Extend the Screen class or one of its subclasses, FullScreen or MainScreen.Adding UI components to a screen1. Cre

Seite 58

150BlackBerry Java Development Environment Development GuideRetrieve module informationRetrieve an array of handles for existing modules on a BlackBer

Seite 59

1519: Managing applicationsRuntime storeBlackBerry® devices use a runtime store as a central location in which applications can share runtime objects.

Seite 60 - Example: MediaSample2.java

152BlackBerry Java Development Environment Development GuideReplace a runtime object. 1. Invoke replace().RuntimeStore store = RuntimeStore.getRuntime

Seite 61

10 Using the messages applicationCreate new messagesCreate new messagesWork with a messageWork with foldersWorking with attachmentsTask StepsCreate a

Seite 62

154BlackBerry Java Development Environment Development GuideCreate a new populated email message. 1. Create and populate a new email message object.n

Seite 63

15510: Using the messages applicationWork with a messageOpen a message1. Retrieve the message store and the folder that contains the message.Task Step

Seite 64

156BlackBerry Java Development Environment Development GuideStore store = Session.waitForDefaultSession.getStore();Folder folder = Store.getFolder(&qu

Seite 65 - Storing data

15710: Using the messages applicationReply to a messageAdd the recipients. 1. Invoke Message.addRecipients() and provide the type of recipient (TO, CC

Seite 66 - Manage persistent data

158BlackBerry Java Development Environment Development GuideForward a messageWork with folders1. Invoke getStore() on the default session.Store store

Seite 67 - Example: UserInfo.java

15910: Using the messages applicationRetrieve an array of folders through a search.>Invoke findFolder(String).Folder[] folders = store.findFolder(&

Seite 68

16BlackBerry Java Development Environment Development GuideCreate an option. 1. Create an instance of a RadioButtonGroup().RadioButtonGroup rbGroup =

Seite 69 - Manage custom objects

160BlackBerry Java Development Environment Development GuideWorking with attachmentsTo open incoming message attachments and create outgoing attachmen

Seite 70

16110: Using the messages applicationSend a message with an attachmentRetrieve information about the attachment.> Invoke the methods of the Support

Seite 71 - Example: Restaurants.java

162BlackBerry Java Development Environment Development Guide

Seite 72

11 Using PIM applicationsUsing the calendarStart the calendar from your applicationUsing the calendarUsing the address bookUsing tasksTask StepsOpen t

Seite 73

164BlackBerry Java Development Environment Development GuideUse the calendarOpen a new populated event. 1. Create a new Event using an EventList objec

Seite 74

16511: Using PIM applicationsAdd appointment information. > To verify that an item supports a field, invoke isSupportedField(int).if (event.isSuppo

Seite 75 - Use the MIDP record store

166BlackBerry Java Development Environment Development GuideSave an appointment. To save an appointment, use the importEvent() method; you do not have

Seite 76

16711: Using PIM applicationsCode sample: Creating new recurring appointmentsTo let the BlackBerry® device user invite attendees to the meeting, combi

Seite 77 - Managing data

168BlackBerry Java Development Environment Development Guide private EventScreen _eventScreen; public static void main(String[] args) {

Seite 78 - Backing up and restoring data

16911: Using PIM applications event = eventList.createEvent(); event.addString(Event.SUMMARY, PIMItem.ATTR_NONE,

Seite 79 - 4: Managing data

171: Creating UIsCreating custom UI componentsTo create custom fields, content menus, layout managers, and lists, use the BlackBerry® APIs.Create a fi

Seite 80 - Access a SyncCollection

170BlackBerry Java Development Environment Development GuideUsing the address bookOpen the address book from your applicationUse contactsTask StepsOpe

Seite 81

17111: Using PIM applicationsCreate a contact. To add a contact to the database, you must commit it. See “Save a contact” on page 173 for more informa

Seite 82 - Using SyncObjects

172BlackBerry Java Development Environment Development GuideAdd contact information. 1. Invoke one of the following methods:• addString()• addStringAr

Seite 83

17311: Using PIM applicationsChange contact information. 1. To change the name and address fields, invoke the appropriate set method to replace an exi

Seite 84

174BlackBerry Java Development Environment Development GuideRetrieve contact information. 1. Invoke PIMList.items().2. Perform one of the following ac

Seite 85

17511: Using PIM applicationsCode sample: Displaying a screen that lets BlackBerry device users add new contactsThe following code sample demonstrates

Seite 86

176BlackBerry Java Development Environment Development Guide{ private ContactScreen _contactScreen; public static void main(String[] args)

Seite 87

17711: Using PIM applications try { ContactList contactList = (ContactList)PIM.getInstance().openPIMList(PIM.CONTACT

Seite 88

178BlackBerry Java Development Environment Development GuideUsing tasksStart the task application from your applicationCheck for a ControlledAccessExc

Seite 89 - Example: RestaurantsSync.java

17911: Using PIM applicationsUse tasksTask StepsOpen a task list. >Invoke PIM.openPIMList() and provide as parameters the type of list to open (PIM

Seite 90

18BlackBerry Java Development Environment Development GuideCreate a custom fieldTask StepsCreate a custom field. You can only add custom context menu

Seite 91

180BlackBerry Java Development Environment Development GuideChange task information. 1. To replace an existing value with a new value, invoke the appr

Seite 92

18111: Using PIM applicationsExport a task. 1. To import or export PIM data, use an output stream writer to export tasks from the BlackBerry® device t

Seite 93

182BlackBerry Java Development Environment Development GuideCode sample:Example: TaskDemo.java/** * TaskDemo.java * Copyright (C) 2002-2005 Research I

Seite 94

18311: Using PIM applications _saveMenuItem = new SaveMenuItem(); setTitle(new LabelField(“Tasks Demo”, LabelField.E

Seite 95

184BlackBerry Java Development Environment Development Guide

Seite 96

12 Using the phone applicationStart the phone application from your applicationTo open the phone application from your application, invoke Invoke.invo

Seite 97 - Using smart cards

186BlackBerry Java Development Environment Development GuideAdd DTMF tones to the send queueBlackBerry DTMF tonesBlackBerry® devices play DTMF tones a

Seite 98

18712: Using the phone applicationListen for phone eventsTo act on a particular event, implement one of the following methods.:Access and use call log

Seite 99

188BlackBerry Java Development Environment Development GuideCode sample: Calculating the time that a participant spends on the phoneExample: PhoneLogs

Seite 100

18912: Using the phone applicationpublic class PhoneLogsDemo extends Application{ private PhoneLogs _logs; private int _timeSpokenTo; sta

Seite 101 - 5: Using smart cards

191: Creating UIsSpecify the arrangement of the objects in the field.1. Implement layout(). Arrange field data so that you perform the most complex ca

Seite 102

190BlackBerry Java Development Environment Development Guide

Seite 103

13 Using the BlackBerry BrowserDisplay content in the BlackBerry BrowserTo display web content in the BlackBerry® Browser, use the net.rim.blackberry.

Seite 104

192BlackBerry Java Development Environment Development GuideDisplay content in a BlackBerry Browser fieldTo display web content in a BlackBerry® Brows

Seite 105

19313: Using the BlackBerry BrowserSet rendering options. > Override BrowserContent.getRenderingOptions(). Your application uses the default render

Seite 106

194BlackBerry Java Development Environment Development GuideCode sample: Using the BlackBerry BrowserExample: BrowserFieldSampleApplication.java/** *

Seite 107

19513: Using the BlackBerry Browser BrowserContent browserContent = null; try { browserContent = _renderingSession.ge

Seite 108

196BlackBerry Java Development Environment Development Guide RedirectEvent e = (RedirectEvent) event; String ref

Seite 109

19713: Using the BlackBerry Browser } /** * @see net.rim.device.api.browser.RenderingApplication#getAvailableWidth(net.rim.device.api.browse

Seite 110

198BlackBerry Java Development Environment Development Guide HttpConnection connection = Utilities.makeConnection(resource.getUrl(), resour

Seite 111

14 Using location informationTypes of location informationUsing BlackBerry MapsBlackBerry® Maps is a mapping and location client application that inte

Seite 112

BlackBerry Java Development Environment Version 4.2.0 Development GuideLast modified: 11 February 2008Part number: 9461716At the time of publication,

Seite 113

20BlackBerry Java Development Environment Development GuideDefine the preferred height of a custom component.> Implement getPreferredHeight(), usin

Seite 114

200BlackBerry Java Development Environment Development GuideCreate a location document to display map dataLocation document tagsLocation document stru

Seite 115 - Managing memory

20114: Using location informationUse the BlackBerry Maps applicationLocating BlackBerry devices using GPS informationTo let your application obtain th

Seite 116 - Free persistent objects

202BlackBerry Java Development Environment Development GuideSelecting a GPS location providerSpecify the desired criteria by creating an instance of t

Seite 117 - Creating connections

20314: Using location informationautonomous required required allowed low, medium, or no requirementfirst fix: assisted subsequent fixes: autonomousre

Seite 118 - Use HTTP connections

204BlackBerry Java Development Environment Development GuideRetrieve BlackBerry device GPS location informationTask StepsSpecify a response time for r

Seite 119 - 7: Creating connections

20514: Using location informationRequirements for retrieving GPS location information from BlackBerry devices that run on the CDMA network If you crea

Seite 120

206BlackBerry Java Development Environment Development GuideSend required PDE data to BlackBerry devices that run on the CDMA networkBefore your appli

Seite 121

20714: Using location information private static float[] _altitudes; private static float[] _horizontalDistances; private static PersistentOb

Seite 122 - Use HTTP authentication

208BlackBerry Java Development Environment Development Guide }// Constructors. ------------------------------------------------------------- pub

Seite 123

20914: Using location information } }; // Cache the close menu item for reuse. private MenuItem _close = new MenuItem(_resources,

Seite 124

211: Creating UIsDefine the appearance of the custom field.1. Perform complex calculations in layout()instead of in paint().2. Implement paint().prote

Seite 125 - Use socket connections

210BlackBerry Java Development Environment Development Guide } /* Marks a point in the persistent store. Calculations are based on * all d

Seite 126 - Datagram connections

21114: Using location information * Rounds off a given double to the provided number of decimal places * @param d the double to round off

Seite 127

212BlackBerry Java Development Environment Development Guide // Running total of the vertical distance gain. float altGa

Seite 128 - Using port connections

21314: Using location information sb.append(“\n”); sb.append(“Altitude: “); sb.append(altitude);

Seite 129

214BlackBerry Java Development Environment Development Guide

Seite 130

15 Creating push applicationsTypes of push applicationsPush applications send web content or data to specific BlackBerry® device users. BlackBerry dev

Seite 131

216BlackBerry Java Development Environment Development GuideTypes of push requestsApplications can send two types of push requests:Request Supported t

Seite 132

21715: Creating push applicationsWrite a client push applicationTask StepsCreate a listening thread. > Send and receive data on a separate thread s

Seite 133

218BlackBerry Java Development Environment Development GuideCode sample: Listening for data from a web serverExample: HTTPPushDemo.java/** * The clien

Seite 134

21915: Creating push applications private boolean _stop = false; private StreamConnectionNotifier _notify; public synchronized vo

Seite 135 - Creating notifications

22BlackBerry Java Development Environment Development GuideCode sample: Creating custom buttonsExample: CustomButtonField.java/** * CustomButtonField.

Seite 136 - Add a new event source

220BlackBerry Java Development Environment Development Guide input.close();

Seite 137 - Code sample:

22115: Creating push applications } } // Constructor. public HTTPPushDemo() { _mainScreen = new HTTPMainScreen(); _m

Seite 138

222BlackBerry Java Development Environment Development GuideWrite a server-side push applicationTo create a push application, you can use any programm

Seite 139 - Triggering events

22315: Creating push applicationsRead the server response. 1. To access an input stream, invoke getInputStream(). InputStream ins = conn.getInputStrea

Seite 140 - Respond to deferred events

224BlackBerry Java Development Environment Development GuideWork with a server-side push requestSend a request to cancel a PAP push submission.1. Use

Seite 141 - Cancel events

22515: Creating push applicationsCreate a RIM push requestTask StepsPush content to one or multiple BlackBerry® device users using a RIM push request.

Seite 142

226BlackBerry Java Development Environment Development GuideCreate a PAP push requestSee “Appendix: XML control entity attributes” on page 275 for mor

Seite 143 - Example: ConsequenceDemo.java

22715: Creating push applicationsCode sample: Pushing data to an application that listens on a BlackBerry deviceThe HTTPPush.java sample application,

Seite 144

228BlackBerry Java Development Environment Development Guide //constructors -------------------------------------------------------------- /** C

Seite 145

22915: Creating push applications setTitle(java.util.ResourceBundle.getBundle(“com/rim/samples/docs/httppush/resources”).getString(“HTTPPushSer

Seite 146

231: Creating UIs /* Constructs a button with specified label and shape, and the default style. */ public CustomButtonField(String label, int sh

Seite 147 - Managing applications

230BlackBerry Java Development Environment Development Guide getContentPane().add(_panel); _panel.setBounds(0, 0, 300, 450); }//GEN-E

Seite 148

23115: Creating push applications System.out.println(new String(someArray)); } conn.disconnect(); } catch

Seite 149 - Managing code modules

232BlackBerry Java Development Environment Development Guide mdsConn.setRequestMethod(“POST”); mdsConn.setAllowUserInteraction(f

Seite 150 - Create code modules

23315: Creating push applications bytesRead = ins.read(buffer); System.out.println(buffer); if (bytesRead

Seite 151 - Share runtime objects

234BlackBerry Java Development Environment Development Guide output.close(); clientSocket.close();

Seite 152

16 Localizing applicationsStoring text strings in resource filesDesign applications so that they are localized (adapted to specific languages and regi

Seite 153 - Create new messages

236BlackBerry Java Development Environment Development GuideFiles required for localizationAdd localization supportFile required for localizationDescr

Seite 154

23716: Localizing applicationsCode sample: Storing text strings in separate resources for localesExample: CountryInfo.java/** * CountryInfo.java * Cop

Seite 155 - Work with a message

238BlackBerry Java Development Environment Development Guidepackage com.rim.samples.docs.countryinfo;import net.rim.device.api.ui.*;import net.rim.dev

Seite 156 - Send a message

23916: Localizing applications private MenuItem _closeItem = new MenuItem(_resources, MENUITEM_CLOSE, 200000, 10) { public void

Seite 157 - Reply to a message

24BlackBerry Java Development Environment Development Guide return _shape; } /* Sets the label. */ public void setLabel(String lab

Seite 158 - Work with folders

240BlackBerry Java Development Environment Development GuideRetrieve strings from a resource fileCode sample: Retrieving strings from a resource fileE

Seite 159

24116: Localizing applicationsimport net.rim.device.api.ui.component.*;import net.rim.device.api.ui.container.*;import net.rim.device.api.system.*;imp

Seite 160 - Working with attachments

242BlackBerry Java Development Environment Development Guide onClose(); } }; protected void makeMenu( Menu menu, int instance

Seite 161

24316: Localizing applicationsManage resource files for application suitesWhen creating a suite of applications, organize the resources into separate

Seite 162

244BlackBerry Java Development Environment Development Guide

Seite 163 - Using PIM applications

17 Testing applicationsTesting applications using the BlackBerry IDEAfter you develop and compile your application, you should test it on the BlackBer

Seite 164 - Use the calendar

246BlackBerry Java Development Environment Development GuideTesting applications using BlackBerry devicesAfter testing your application on the BlackBe

Seite 165 - 11: Using PIM applications

24717: Testing applicationsOne debugging method is to start by setting only a few breakpoints at critical sections of your code, and then gradually se

Seite 166

248BlackBerry Java Development Environment Development GuideManage a debugging sessionLocate an error in the source code1. In the Output window, doubl

Seite 167 - ContactsDemo.java

24917: Testing applicationsInstall .debug files on your computerTo debug applications using a BlackBerry® device, the .debug files in the BlackBerry I

Seite 168

251: Creating UIs // Update the cached font in case it has been changed. _font = getFont(); _labelHeight = _font.getHeight();

Seite 169

250BlackBerry Java Development Environment Development GuideYou can now run your applications on the BlackBerry device and use the BlackBerry Integrat

Seite 170 - Using the address book

25117: Testing applications10. Repeat steps 1 through 8, setting breakpoints closer together until they converge on the memory leak.Display objects in

Seite 171

252BlackBerry Java Development Environment Development GuideRight-click an object, and then click Show Recursive References To @nnnnnnnn to display al

Seite 172

25317: Testing applicationsEvaluate (watch) Java expressionsThe Watch pane lets you specify variables and expressions to watch continuously while debu

Seite 173

254BlackBerry Java Development Environment Development GuideMake a thread currentWhen you make a thread current, the Call Stack changes to display the

Seite 174

25517: Testing applicationsView the source of a logging message> In the event log pane, on the Build tab, double-click the error message.View class

Seite 175 - Example: ContactsDemo.java

256BlackBerry Java Development Environment Development Guide3. Click the Colors tab to change the colors of the source code highlighting.Generate prof

Seite 176

25717: Testing applications13. In the profile pane, click Refresh. This action retrieves all accumulated profile data from the JVM. This action does n

Seite 177

258BlackBerry Java Development Environment Development GuideRun the Coverage tool1. Set two or more breakpoints in your code.2. Run the application to

Seite 178 - Using tasks

25917: Testing applicationsStart the BlackBerry email simulatorThe BlackBerry® email simulator lets you send and receive email messages between the Bl

Seite 179 - Use tasks

26BlackBerry Java Development Environment Development Guide textWidth ); }}Create custom context menusTask StepsCreate the custom conte

Seite 180

260BlackBerry Java Development Environment Development GuideWorking with compiled applicationsWhen you build a project using the BlackBerry® Integrate

Seite 181

26117: Testing applicationsView application information1. Connect the BlackBerry® device to the computer.2. Open a command prompt and navigate to the

Seite 182

262BlackBerry Java Development Environment Development Guide

Seite 183

18 Packaging and distributing applicationsPreverify applicationsTo reduce the amount of processing the BlackBerry® device performs when you load your

Seite 184

264BlackBerry Java Development Environment Development GuideIf you use any of the following BlackBerry API packages, your application requires code si

Seite 185 - Using the phone application

26518: Packaging and distributing applications6. In the Private Key Password field, type a password of at least eight characters. The private key pass

Seite 186 - BlackBerry DTMF tones

266BlackBerry Java Development Environment Development GuideRequest code signatures using a proxy serverRequest a replacement registration keyYour reg

Seite 187 - Access and use call logs

26718: Packaging and distributing applicationsDistributing applications over the wireless networkDistribute applicationsMethod DescriptionUser-initiat

Seite 188 - Example: PhoneLogsDemo.java

268BlackBerry Java Development Environment Development GuideExtract sibling .cod files. To ensure a BlackBerry device user does not override the origi

Seite 189

26918: Packaging and distributing applicationsDistributing applications with the BlackBerry Desktop SoftwareCreate an application loader file1. Create

Seite 190

271: Creating UIsCode sample: Creating a custom context menuExample: ContextMenuSample.java/** * ContextMenuSample.java * Copyright (C) 2001-2005 Rese

Seite 191 - Using the BlackBerry Browser

270BlackBerry Java Development Environment Development GuideMy_application.cod </files> 5. Update the application, description, and other tags t

Seite 192

27118: Packaging and distributing applicationsnet_rim_resource.codnet_rim_resource__en.codnet_rim_resource__fr.cod</files></fileset></a

Seite 193

272BlackBerry Java Development Environment Development Guide• Round brackets () indicate exclusive (open) range matching.• Missing lower ranges imply

Seite 194

A Appendix: The command line compilerUsing the command line compilerThe BlackBerry® Java™ Development Environment includes RAPC, a command line compil

Seite 195

274BlackBerry Java Development Environment Development GuideFor example, the following command line instruction compiles the SampleApp.jar file into a

Seite 196

B Appendix: XML control entity attributesUsing XML control entity attributesUse the PAP DTD to specify the following attributes:Using XML control enti

Seite 197

276BlackBerry Java Development Environment Development GuideSee the Push Access Protocol (WAP-247-PAP-20010429-a) specification at http://www.wmlclub.

Seite 198

C Appendix: .alx filesElements in BlackBerry application .alx filesElements in BlackBerry application .alx filesElement Attributes Descriptionapplicat

Seite 199 - Using location information

278BlackBerry Java Development Environment Development Guidefileset JavaradiolangidColourThe fileset element includes an optional directory element an

Seite 200 - Location document structure

279 Appendix: .alx filesrequires idThe requires element is an optional element that specifies the id of a package on which this application depends. T

Seite 201

28BlackBerry Java Development Environment Development Guide protected void makeContextMenu(ContextMenu contextMenu) { contextM

Seite 202

280BlackBerry Java Development Environment Development Guide

Seite 203

D Appendix: BlackBerry application .jad filesProperties of BlackBerry application .jad filesThe BlackBerry® Integrated Development Environment lets yo

Seite 204

282BlackBerry Java Development Environment Development Guide

Seite 205

Acronym listAAESAdvanced Encryption StandardAPIapplication programming interfaceAPNAccess Point NameATRAnswer To ResetBbpmbeats per minuteCCACcommon a

Seite 206

284BlackBerry Java Development Environment Development GuidePOSTpower-on self-testRRAMrandom access memorySS/MIMESecure Multipurpose Internet Mail Ext

Seite 208

©2006 Research In Motion LimitedPublished in Canada.

Seite 209

291: Creating UIsCreate custom layout managersTask StepsCreate a custom layout manager. > Extend the Manager class or one of its subclasses.class D

Seite 210

no representation, warranty or guarantee whatsoever in relation to the Third Party Information and RIM assumes no liability whatsoever in relation to

Seite 211

30BlackBerry Java Development Environment Development GuideCode sample: Creating a custom layout managerExample: DiagonalManager.java/** * DiagonalMan

Seite 212

311: Creating UIspackage com.rim.samples.docs.custommenu;import net.rim.device.api.system.*;import net.rim.device.api.ui.container.*;import net.rim.de

Seite 213

32BlackBerry Java Development Environment Development Guide return index;}}}

Seite 214

331: Creating UIsCreate custom listsTask StepsLet users BlackBerry® device select multiple items in a list.> Declare lists as MULTI_SELECT.Create a

Seite 215 - Creating push applications

34BlackBerry Java Development Environment Development GuideCode sample: Creating a custom listExample: SampleListFieldCallback.java/** * SampleListFie

Seite 216 - Types of push requests

351: Creating UIs myList.insert(1); myCallback.insert(fieldTwo, 1); myList.insert(2); myCallback.insert(fieldThree, 2);

Seite 217

36BlackBerry Java Development Environment Development GuideAdding menu items to BlackBerry applicationsThe Application Menu Item API, in the net.rim.b

Seite 218 - Example: HTTPPushDemo.java

371: Creating UIsCode sample: Creating a new menu item in a BlackBerry applicationThe menu item appears when a BlackBerry® device user views a contact

Seite 219

38BlackBerry Java Development Environment Development Guide DemoAppMenuItem() { long locationToAddMenuItem = ApplicationMenuItemRepository.M

Seite 220

391: Creating UIs• VerticalFieldManager• HorizontalFieldManager• FlowFieldManager• DialogFieldManagerTo create a custom layout manager, extend Manager

Seite 222

40BlackBerry Java Development Environment Development GuideDefine a layout managerSet field focus and navigationUI EventListeners let applications res

Seite 223

411: Creating UIsInterpret the status parameter of the navigation methods.> In your implementation of one of the navigationClick, navigationUnclick

Seite 224

40BlackBerry Java Development Environment Development GuideDefine a layout managerSet field focus and navigationUI EventListeners let applications res

Seite 225 - Create a RIM push request

431: Creating UIsManage foreground eventsThe system calls Application.activate() when it brings an application to the foreground. Manage drawing areas

Seite 226 - Create a PAP push request

44BlackBerry Java Development Environment Development Guide

Seite 227 - BlackBerry device

2 Using graphics and multimediaUsing imagesUse raw imagesUsing imagesDrawing and rendering imagesUsing audioUsing rich mediaTask StepsAllow applicatio

Seite 228

46BlackBerry Java Development Environment Development GuideUse encoded imagesTask StepsAccess an image. 1. Save an image to the project folder or subf

Seite 229

472: Using graphics and multimediaCode sample: Using a raw image to recreate an encoded imageExample: ImageDemo.java/** * ImageDemo.java * Copyright (

Seite 230

48BlackBerry Java Development Environment Development Guide try { EncodedImage image = EncodedImage.createEncode

Seite 231

492: Using graphics and multimediaDetermine the raster operations that the application supports.1. Invoke Graphics.isRopSupported(int).2. Provide one

Seite 232

Contents1 Creating UIs ...

Seite 233

50BlackBerry Java Development Environment Development GuideCode sample: Drawing a new bitmap using an existing bitmapExample: DrawDemo.java/* * DrawDe

Seite 234

512: Using graphics and multimedia System.out.println(“Error occurred during drawing: “ + e); } if(restored.equ

Seite 235 - Localizing applications

52BlackBerry Java Development Environment Development GuideCode sample: Creating a player for a sequence of tonesExample: Sequence of tones// "Ma

Seite 236 - Add localization support

532: Using graphics and multimedia// Play "C" sectionD4, duration, D4, duration, E4, duration, D4, duration, C4, duration};try{ Player p = M

Seite 237 - Example: CountryInfo.java

54BlackBerry Java Development Environment Development GuidePlay mediaListen for media player eventsTask StepsPrepare the media player. 1. Invoke Playe

Seite 238

552: Using graphics and multimediaUsing rich mediaPlaying rich media contentTo play rich media content, use the following classes:• To retrieve .pme c

Seite 239

56BlackBerry Java Development Environment Development GuideCode sample: Retrieving and displaying a rich media fileThe MediaSample.java code sample re

Seite 240

572: Using graphics and multimedia MediaPlayer player = new MediaPlayer(); MediaManager manager = new MediaManager()

Seite 241

58BlackBerry Java Development Environment Development GuideCode sample: Managing rich media content download eventsExample: Managing rich media conten

Seite 242

592: Using graphics and multimedia...break;}break;...switch(s.getStatus()) { case LoadingStatus.LOADING_STARTED:System.out.println("Loading in pr

Seite 243

Code sample: Using a raw image to recreate an encoded image...47Drawing and rendering images ...

Seite 244

60BlackBerry Java Development Environment Development GuideExample: MediaSample2.java/** * MediaSample2.java * Copyright (C) 2001-2005 Research In Mot

Seite 245 - Testing applications

612: Using graphics and multimedia case LoadingStatus.LOADING_STARTED: System.out.println(“Loading i

Seite 246 - Debugging applications

62BlackBerry Java Development Environment Development Guide player.addMediaListener(_listener); manager.addMediaListener(_listen

Seite 247 - 17: Testing applications

632: Using graphics and multimedia } public InputStream getInputStream(String uri, ConnectionInfo info) throws IOException, MediaExcepti

Seite 248 - Manage a debugging session

64BlackBerry Java Development Environment Development Guide

Seite 249

3 Storing dataUse BlackBerry persistent storageBlackBerry persistent storageUse BlackBerry persistent storageManage persistent dataManage custom objec

Seite 250 - Locate a memory leak

66BlackBerry Java Development Environment Development GuideManage persistent dataData integrity To maintain the integrity of data in persistent storag

Seite 251 - Display format

673: Storing dataCode sample: Saving user name and password informationThis code sample demonstrates how to create an application for BlackBerry® devi

Seite 252 - View static data

68BlackBerry Java Development Environment Development Guide private AutoTextEditField currentusernamefield; private AutoTextEditField currentpas

Seite 253 - View threads

693: Storing data currentpasswordfield = new AutoTextEditField( _resources.getString(FIELD_CURRENTPASSWORD), ““); SeparatorFi

Seite 254 - View event logs

Activate synchronization when the BlackBerry device starts...89Code sample: Letting the BlackB

Seite 255 - View classes

70BlackBerry Java Development Environment Development GuideStore data persistently. > In the class for the objects that you want to store, implemen

Seite 256 - Generate profile data

713: Storing dataCode sample: Storing and viewing restaurant informationThis code sample lets BlackBerry® device users save information about multiple

Seite 257 - Analyze code coverage

72BlackBerry Java Development Environment Development Guide public void run() { RestaurantInfo info = new RestaurantInfo();

Seite 258 - Approve HTTP connections

733: Storing data public void run() { synchronized(store) { String websiteUrl = websitefield.getText();

Seite 259

74BlackBerry Java Development Environment Development Guide _elements[id] = value; } } private final class RestaurantsMain

Seite 260 - Load and remove applications

753: Storing dataUse the MIDP record storeTask StepsCreate a record store. >Invoke openRecordStore() and specify true to indicate that the method s

Seite 261 - View application information

76BlackBerry Java Development Environment Development Guide

Seite 262

4 Managing dataData synchronizationResearch In Motion (RIM) does not provide tools or applications for synchronizing data to remote data sources, so y

Seite 263 - Preverify applications

78BlackBerry Java Development Environment Development GuideBacking up and restoring dataAdd support for backing up data over the wireless networkTask

Seite 264

794: Managing dataUniquely identify each record type in a SyncCollection.>Invoke the SyncCollectionSchema.setDefaultRecordType()method. The followi

Seite 265 - Request code signatures

Use USB or serial port connections...128Use Bluetoot

Seite 266 - View signature status

80BlackBerry Java Development Environment Development GuideAccess a SyncCollectionTask StepsRetrieve an instance of the SyncCollection from the RunTim

Seite 267 - Distribute applications

814: Managing dataNotify the system when a SyncCollection changesTask StepsUse a collection listener to notify the system when a SyncCollection change

Seite 268

82BlackBerry Java Development Environment Development GuideUsing SyncObjectsCode sample: Using a SyncCollection to back up data over the wireless netw

Seite 269 - Software

834: Managing dataimport java.io.*;import java.util.*;import net.rim.device.api.collection.*;import net.rim.device.api.i18n.*;import net.rim.device.ap

Seite 270 - Specify optional components

84BlackBerry Java Development Environment Development Guide _schema.setDefaultRecordType(DEFAULT_RECORD_TYPE); _schema.setKeyFieldIds(DE

Seite 271

854: Managing data int length = data.readShort(); byte[] bytes = new byte[length]; switch (data.readByte(

Seite 272

86BlackBerry Java Development Environment Development Guide } public boolean removeAllSyncObjects() { return false; //na }

Seite 273

874: Managing data public String getSyncName(Locale locale) { return null; } public SyncConverter getSyncConverter() {

Seite 274

88BlackBerry Java Development Environment Development GuideAdd support for backing up data with the BlackBerry Desktop SoftwareTask StepsLet your appl

Seite 275

894: Managing dataActivate synchronization when the BlackBerry device startsCode sample: Letting the BlackBerry Desktop Software back up and restore a

Seite 276 - WAP Push DTDs

Working with attachments ...160

Seite 277 - Appendix: .alx files

90BlackBerry Java Development Environment Development Guidepackage com.rim.samples.docs.restaurantssync;import java.io.*;import net.rim.device.api.ui.

Seite 278

914: Managing data _data = (Vector)store.getContents(); if (!_data.isEmpty()) { RestaurantInfo info =

Seite 279 - Appendix: .alx files

92BlackBerry Java Development Environment Development Guide public static final int SPECIALTY = 3; private int _uid; publ

Seite 280

934: Managing data break; default: data.readFully(bytes); brea

Seite 281 - Set .cod file dependencies

94BlackBerry Java Development Environment Development Guide return this; } public String getSyncName() { return “Restaurant Sy

Seite 282

954: Managing data public void setSyncObjectDirty(SyncObject object) { } public boolean updateSyncObject(SyncObject oldObject, SyncOb

Seite 283 - Acronym list

96BlackBerry Java Development Environment Development Guide

Seite 284

5 Using smart cardsSmart cardsAdding support for unsupported smart cardsSmart cards are credit card-sized devices that are designed to store and trans

Seite 285

98BlackBerry Java Development Environment Development GuideCode sample: Creating a smart card objectExample: MyCryptoSmartCard.java/*** MyCryptoSmartC

Seite 286 - Published in Canada

995: Using smart cardsprivate static final String LABEL = “RIM Sample”;private static final String DISPLAY_SETTINGS = “Show driver properties/settings

Kommentare zu diesen Handbüchern

Keine Kommentare