BlackBerry Java Application

Core Version: 5.0
Development Guide

Published: 2010-12-10 SWD-790641-1210113811-001

Contents
1 Managing applications...................................................................................................................................... Application manager......................................................................................................................................... Retrieve information about a BlackBerry Java Application....................................................................... Communicate with another BlackBerry Java Application.......................................................................... Determine the services that are available to a BlackBerry Java Application............................................. Application control........................................................................................................................................... Request access to resources...................................................................................................................... Code modules................................................................................................................................................... Retrieve module information.................................................................................................................... Access control messages.................................................................................................................................. Displaying a message for an operation that requires user permission..................................................... Display an application control message to a user..................................................................................... 2 Storing data...................................................................................................................................................... Data management............................................................................................................................................ Access to memory............................................................................................................................................. File systems and paths...................................................................................................................................... File Connections APIs........................................................................................................................................ Storage on removable media............................................................................................................................ Accessing data on the microSD media card............................................................................................... Using the microSD media card with more than one BlackBerry device.................................................... File encryption on microSD cards.............................................................................................................. IT policies and the microSD media card..................................................................................................... Encryption of data on a microSD media card............................................................................................ Code sample: Reading sections of a binary file................................................................................................ Persistent data storage..................................................................................................................................... Create a persistent data store................................................................................................................... Store persistent data................................................................................................................................. Retrieve persistent data............................................................................................................................ Remove persistent data............................................................................................................................. MIDP record storage......................................................................................................................................... Create an MIDP record store..................................................................................................................... Add a record to a record store.................................................................................................................. Retrieve a record from a record store....................................................................................................... Retrieve all records from a record store.................................................................................................... Collections........................................................................................................................................................ Retrieve a collection from persistent storage........................................................................................... 5 5 5 5 6 6 6 7 7 7 7 7 9 9 9 9 9 10 10 10 10 10 10 11 12 12 13 13 14 14 14 14 14 15 15 15

.................................... Wireless access families.......................................................................... Runtime storage.......................................................................................................................... 3 Creating connections....... Using the BlackBerry Enterprise Server as an intranet gateway..................................................... Replace an object in the runtime store................ Connections.................................................................................. Use an HTTPS connection.................... Use a socket connection............................................................................................................................................... Open a Wi-Fi HTTPS connection................................................................................................................................. Using the wireless service provider's Internet gateway.......................................................................................................................................................................................................................................................................................................................................................................................... Wi-Fi connections............................................. Code sample: Displaying available transport types.................................................................................................................................................................................... Retrieve a registered runtime object................................................................................................................................................................................................................................................................................................................................................... 16 17 17 18 18 18 18 19 19 20 20 20 21 21 21 21 23 23 25 26 27 28 28 29 29 29 29 29 29 29 30 30 30 31 31 31 32 33 ............................................................................ Use a USB or serial port connection......................................... Retrieve the wireless network name...................................................... Add an object in the runtime store..................Create a collection listener to notify the system when a collection changes.. Check if the Wi-Fi transceiver is turned on...................................... Open a Wi-Fi HTTP connection. Determine if a BlackBerry device supports multiple wireless access families.... Retrieve the runtime store................................................................................................... Code sample: Creating a connection over HTTP by using the first available transport.................................................................................................................... Use a Bluetooth serial port connection............................................................................................................... Use HTTP authentication............................................................................................. Retrieve the wireless access families that a BlackBerry device supports............................................................................................................................................................ Check if the Wi-Fi transceiver is connected to a wireless access point................................................................................................................................................................................................. Retrieve an unregistered runtime object.................................................................... Use a datagram connection............ Open a Wi-Fi socket connection....................................................................................................................................... Remove a collection listener that notifies the system when a collection changes.................................................................................................................................................................... Determine the wireless access family transceivers that are turned on........................... Retrieve the wireless network name.......................... Turn on the transceiver for a wireless access family................................................................................................ Notify the system when a collection changes................................................................................................................................... Network connections and transport types................................................................................................. Enhanced Network API........................................................................................................................................................................... Turn off the transceiver for a wireless access family........................................... Retrieve the status of the wireless access point or the active Wi-Fi profile.................................

........................................ Restrictions on code signatures............................................................................................................ 5 Testing a BlackBerry device application..... Properties of BlackBerry device application .............................................. Protect APIs using code signing keys..................................... Wireless push (server-initiated)....................................... Testing applications on a BlackBerry device......................................................................................................................................................... 6 Packaging and distributing a BlackBerry Java Application............................................................................................................................................................................................. Sign an application using a proxy server.... Protect runtime store data using code signing keys.................................... Create .................................................................................................cod file for testing..............................................................cod files....... View the signature status for an application................... Check if a code signature is required............................................................................................................................... Using keys to protect APIs and data............................................cod files........................................................................................................................................................................................................................................................................................................................ Save a ......................................................................................... Protect persistent data using code signing keys........................... Application distribution through a computer connection............... Wireless pull (user-initiated).............................................. Testing applications using the compiled ................................................................................................................................................................ 35 35 35 36 36 37 37 38 38 38 38 39 40 41 41 41 41 42 42 42 44 44 44 44 44 45 45 45 46 47 47 47 47 52 52 52 .......cod file......................................................................................................................alx file.................................................................cod files........................................ Distributing BlackBerry device applications with the BlackBerry Desktop Software.............................................................................................................................. Distribute an application from a web page................................................... Register a signature key using a proxy server.....................cod file sizes listed in a .............................................................. Elements in BlackBerry device application ..........................jad files that reference multiple ................................................................ Request a code signature... Testing applications on a BlackBerry Smartphone Simulator.............................................................................. Java APIs with controlled access............................ Preverify a BlackBerry device application.........................................................................................................cod file from a device to a computer...............................................................................................4 Controlling access to APIs and application data................................................................................................................................................................................................. Modifying information for a MIDlet suite............ Extract sibling .................jad files.......................................................................................................................................................................................... Install and remove a ................................................ Correct the ................................................................................................................................ Distribute an application from a computer................................ Retrieve information about a ........... Application distribution over the wireless network............................................................................................................................................................................................................ Register to use controlled APIs.......................................... Distributing BlackBerry Java Applications over the wireless network..............................jad file..............................................................................................

............................................ Specifying supported versions of the BlackBerry Device Software............................................................................................................................................................................................................................................ Specifying a location for your application on a BlackBerry device....................................... 8 Custom user authentication................... Manage localization files for a suite of BlackBerry device applications...................................................................................................................................................................................................................................... 9 Glossary...................................................... Multilanguage support................................................... 7 Localizing BlackBerry device applications.................................................................................................................................................................Distribute an application for testing.............................................................................................................................. Files required for localization.................................................. 13 Legal notice............................................................................. 11 Related resources...................................................... Distributing an application from a computer................................................. 12 Document revision history................................................................................................. Create an application loader file................................................................................................................................................................................................................................ 52 53 53 53 54 55 56 57 57 57 58 59 60 63 64 65 66 ............. Specify a location for your application on a BlackBerry device................... Install a BlackBerry device application on a specific device................................................................................................................................................................................................................................................................................ 10 Provide feedback.................................................

postGlobalEvent() methods. To post a system-level event to another BlackBerry® device application.getVisibleApplications(). To retrieve information about the processes that are running.ApplicationDescriptor. invoke ApplicationDescriptor. java.system.ApplicationManager.*. 5 . such as retrieving the IDs for foreground applications post global events to the system run an application immediately or at a specific time Retrieve information about a BlackBerry Java Application 1. Communicate with another BlackBerry Java Application 1.String. Import the required classes and interfaces.api. To retrieve a description of the current application.api.api.ApplicationManager class.api.system.system.system.Development Guide Managing applications Managing applications Application manager 1 The BlackBerry® Java® Virtual Machine on the BlackBerry® device includes an application manager that is the central dispatcher of operating system events for other BlackBerry device applications. 3.getVisibleApplications().getName().ApplicationManager class lets applications interact with the application manager to perform the following actions: • • • interact with processes.getName().rim.rim.device.currentApplicationDescriptor(). To retrieve descriptions of the objects for the BlackBerry® device applications that are running. invoke ApplicationDescriptor. invoke ApplicationManager.device.getApplicationManager().device. ApplicationDescriptor descriptor = ApplicationDescriptor. ApplicationManager manager = ApplicationManager.api. 2. import import import import net. Import the net.device. net. String appname1 = descriptors[0]. invoke one of the ApplicationManager.rim. 2. net.device.rim.lang. 4. The net.rim.currentApplicationDescriptor().system. ApplicationDescriptor descriptors[] = manager.

applicationcontrol. the network gateway. Specify the build request to ask for event injection privileges.device.api. Request access to resources 1. If the administrator or a user denies the application access to one of the protected areas.addPermission( ApplicationPermissions.device. Application control The BlackBerry® Application Control IT policy rules provide administrators with the ability to establish the capabilities of an application when it runs on a specific BlackBerry device. This IT policy does not apply to BlackBerry devices that use the BlackBerry® Internet Service only.ApplicationPermissionsManager.device.servicebook).Development Guide Application control Determine the services that are available to a BlackBerry Java Application The service book consists of service records.servicebook class. The BlackBerry Application Control IT policy rule works only when the BlackBerry device is connected to a BlackBerry® Enterprise Server. } 6 .out.rim. permissions.println("The user allowed requested permissions.api. the associated method throws a ControlledAccessException. Create an instance of the ApplicationPermissions class.").PERMISSION_EVENT_INJECTOR ). For class-level checks. administrators can use the BlackBerry Application Control IT policy rule to make sure that a game that exists on the BlackBerry device cannot access the phone API. Depending on which APIs that you use. Import the net. 4. } else { System. 2. import net. use the service book API (net. and the configuration information such as the browser settings.ApplicationPermissions. if(ApplicationPermissionsManager. 1. ApplicationPermissions permissions = new ApplicationPermissions().out. the method throws a NoClassDefFoundError. 3. 2.rim.api.invokePermissionsRequest (permissions)) { System. Import the required classes and interfaces.device. To let your BlackBerry device application interact with the BlackBerry® Infrastructure. Service records define the communication protocol (WAP or IPPP). For example.println("The user denied requested permissions. import net.rim.applicationcontrol.api. your application might need to handle both types of errors.rim. Each service record defines a service on a BlackBerry® device.getInstance(). Determine the access control settings that the BlackBerry® device user specifies.").

To retrieve specific information about a module. and provide the name of the code module as a parameter. int size = CodeModuleManager. Access control messages Displaying a message for an operation that requires user permission You can use the components of the net. String vendor = CodeModuleManager. String name = CodeModuleManager.api. the application displays the message from ReasonProvider A.getModuleHandle("test_module"). invoke getModuleHandle().getModuleDescription( handle ). if an application registers a ReasonProvider A before ReasonProvider B. To retrieve a handle for a module. Import the net. applicationcontrol. For example. You can use the applicationcontrol package to include a custom message with the default message that an application displays in response to an application control.getModuleTimestamp( handle ).device.rim.getModuleCodeSize( handle ). To retrieve an array of handles for existing modules on a BlackBerry® device.rim.getModuleHandles().CodeModuleManager class.rim. 2.device. and provide the module handle as a parameter to these methods.getModuleVersion( handle ). int handle = CodeModuleManager. For example. String description = CodeModuleManager. Display an application control message to a user A BlackBerry® device application can include more than one registered ReasonProvider.getModuleName( handles[0]).device.The application displays messages from ReasonProviders in the order that each ReasonProvider registers with the application.getModuleName( handle ).Development Guide Code modules Code modules Retrieve module information 1.applicationcontrol package to let a BlackBerry® device application display custom messages to a BlackBerry device user when the application attempts an operation that the user must permit.api. 3. 7 . you can use PERMISSION_PHONE for an operation that requires access to the phone functionality of the device.api.ReasonProvider interface.getModuleVendor( handle ). String name = CodeModuleManager. int timestamp = CodeModuleManager. invoke the methods of the CodeModuleManager class. int handles[] = CodeModuleManager.system. 4. Import the net. invoke getModuleHandles(). followed by the message from ReasonProvider B. 1. int version = CodeModuleManager. The application displays information about the type of permission that the user must provide.

In your implementation of the ReasonProvider.getMessage(int permissionID) method. return a String value that contains the message to display to the user.Development Guide Access control messages 2. 8 .

The BlackBerry Persistent Store APIs and the MIDP RMS APIs provide support for JSR 37 and JSR 118. With either the BlackBerry Persistent Store APIs or the MIDP RMS APIs. The data persists even if you remove the battery from the BlackBerry device. or communicate with other applications. File system mounting point internal flash media card Path file:///store/. You must use the JSR 75 APIs or SQLite to store data on a media card. A BlackBerry device that runs BlackBerry® Device Software version 4.Development Guide Storing data Storing data Data management 2 You can store data to persistent memory on the BlackBerry® device. Custom applications can only access persistent storage or user data. through specific APIs. to provide an audit trail of applications that use sensitive APIs. 9 . they cannot access the virtual memory or the persistent storage of other applications (unless they are specifically granted access to do so). A BlackBerry device that runs BlackBerry® Device Software version 5. Research In Motion must digitally sign applications that use certain BlackBerry APIs.2 or later also provides a traditional file system and support for saving content directly to the file system using JSR 75 APIs. you can store data persistently to flash memory. file:///SDCard. BlackBerry device applications can write only to the BlackBerry device memory that the BlackBerry Java Virtual Machine uses.0 or later also supports the use of SQLite®. Access to memory The BlackBerry® Java® environment is designed to inhibit applications from causing problems accidentally or maliciously in other applications or on the BlackBerry device. File Connections APIs The File Connection APIs provide a traditional file system. File systems and paths The file systems on a BlackBerry® device have corresponding file paths that you use to access them. You can view data in the file system and move the data to a computer by using Windows®. and support for saving data directly to the file system on the BlackBerry® device or to a microSD card.

Development Guide Storage on removable media Storage on removable media Accessing data on the microSD media card The javax. Except for media files. the BlackBerry device prompts the BlackBerry device user to enter the microSD media card password. This exception is thrown when a method requires a specific security mode (for example READ or WRITE) and the open connection is not in that mode. Using the microSD media card with more than one BlackBerry device If the BlackBerry® device user moves the microSD media card to a BlackBerry device that does not use a device password or uses a password that does not successfully decrypt the microSD media card master key.microedition. You can also implement the FileConnection interface to access BlackBerry® device ring tones and camera images.file package supports the JSR 75 File Connection APIs and is used in applications to access the file system for the microSD media card. Encrypted files have a . Encryption of data on a microSD media card When a BlackBerry® Java® Application accesses a file on the microSD memory card. An application can use this API to access files or directories. If the BlackBerry device has a password. file decryption occurs and the file moves to main memory for an application to read. File encryption on microSD cards IT policies and the microSD media card You can apply the IT policy Encrypt data written to the microSD media card to any new or modified files that you store on the microSD media card.io. An application can use this API as a central registry for file system listeners that listen for the addition or removal of file systems. all content is encrypted. 10 . An application can use this API to receive status notifications when the application adds or removes a file system root. the BlackBerry device user can use the prompt to change the microSD media card password to the BlackBerry device password.rem extension and cannot be decrypted on platforms other than BlackBerry. Class or interface ConnectionClosedException FileConnection FileSystemListener FileSystemRegistry IllegalModeException Description This exception is thrown when an application invokes a method on a closed file connection. Only the files that you store on the microSD media card after an administrator sets the IT policy are encrypted. the BlackBerry device must not be locked. For a BlackBerry Java Application to access a file that is password protected.

net.*. System.api. import import import import import import import net. } } class HomeScreen extends MainScreen { public HomeScreen() { setTitle("Random File Access Sample").device.*.*.component. app.gif file in the root folder of a media card in a BlackBerry® device. net. 11 . } DataInputStream in = fc. net. the data on the microSD media card is no longer accessible.ui. boolean bFileExists = fc.ui.*. Code sample: Reading sections of a binary file This code sample demonstrates how to read sections of a binary file by reading header information from a .exit(0).device.device. To run the code sample you must place a .exists(). if (!bFileExists) { Dialog.microedition.io.openDataInputStream(). The BlackBerry device uses a master key stored on the microSD media card to encrypt BlackBerry device media files. try { FileConnection fc = (FileConnection)Connector.device. java.alert("Cannot find specified GIF file.api.gif"). } public RandomFileAccess() { pushScreen(new HomeScreen()).api.gif file.rim.ui.io. start the BlackBerry device and remove all encrypted media files. javax.io. The master key prevents the BlackBerry device from having to decrypt or re-encrypt all media files when you disable encryption or change the password.file.open("file:///SDCard/ test.rim.rim. javax.microedition.Development Guide Code sample: Reading sections of a binary file If the NVRAM is removed and the microSD media card is locked with a BlackBerry device key.api.enterEventDispatcher().*. To remove data that is not accessible.").rim. public class RandomFileAccess extends UiApplication { public static void main(String[] args) { RandomFileAccess app = new RandomFileAccess().*. The application reads the width and height of the image from the header.container.*.io.

in. Include a comment in your code to indicate the string that you used to generate the unique long key. } } } catch (IOException ioe) { ioe. using the unique long key as a parameter. To create a persistent data store. Import the following classes: • net. create a single static PersistentObject and invoke PersistentStore. if ( in instanceof Seekable ) { ((Seekable) in).device.2). type a string value.rim.String • net. com.device. } Persistent data storage Create a persistent data store Each PersistentObject has a unique long key. } int widthPixels = widthBytes[0] + 256 * widthBytes[1]. 12 . 5.read(widthBytes.PersistentStore • java.read(heightBytes.lang.rim. fc.close().api.rim.docs.close(). in.device. 4.component. byte[] heightBytes = new byte[2].ui.api.printStackTrace().0.userinfo’ to long.setPosition(6).rim.system.setPosition(8). Right-click the string and click Convert ‘com. in. in the BlackBerry® Integrated Development Environment. int heightPixels = heightBytes[0] + 256 * heightBytes[1]. add(new LabelField("Width: " + widthPixels + "\nHeight: " + heightPixels)).getPersistentObject.0.2).userinfo 2.api.PersistentObject • net. 3. 1.Dialog To create a unique long key.samples. ((Seekable) in).docs.Development Guide Persistent data storage byte[] widthBytes = new byte[2].samples.system.rim.

} } 2.getPersistentObject( 0xa1a569278238dad2L ). String[] userinfo = {username. invoke forceCommit() while synchronizing the monitor object.rim. 13 . Invoke commit() as necessary.ui.api. 3.api. 5.getContents()returns. invoke PersistentStore.commit(). To convert to your desired format. Import the following classes: • net. This method replaces existing content with the new content.component.rim.api.api.alert(_resources.getSynchObject(). To save the new content to the persistent store. Import the following classes: • net.getContents(). the entire batch transaction fails. synchronized(store) { String[] currentinfo = (String[])store.Dialog Invoke getContents() on a PersistentObject. To use a batch transaction to commit objects to the persistent store. If any commit in the batch fails. static { store = PersistentStore.PersistentStore • net.system. Synchronize on the object. if(currentinfo == null) { Dialog.device.rim. password}. b. } 2.setText(currentinfo[0]). perform an explicit cast on the object that PersistentObject. currentpasswordfield. 4. a.Development Guide Persistent data storage static PersistentObject store.device.rim.PersistentObject Invoke setContents() on a PersistentObject. To commit a monitor object separately from a batch transaction.setContents(userinfo). This method retrieves the persistent store monitor that locks the object. } Store persistent data 1. Retrieve persistent data 1.PersistentObject • net.setText(currentinfo[1]). } else { currentusernamefield.system.device.system.getString(APP_ERROR)). synchronized(store) { store. store.device. 3. invoke commit().

Development Guide MIDP record storage Remove persistent data If you delete the . A garbage collection operation removes the data.PersistentObject To remove all persistent data from a BlackBerry® device application. MIDP record storage Create an MIDP record store 1. Import the javax. 0. Invoke openRecordStore().cod file created are deleted.device. then all persistent objects that the .getBytes().RecordStore class. 2.system.RecordStore • java.String Invoke getRecord(int. Add a record to a record store 1. RecordStore store = RecordStore. true). int id = store. Invoke addRecord().openRecordStore("Contacts".rim. Import the following classes: • javax.length()).PersistentStore • net.destroyPersistentObject(). byte[].api.rim. invoke PersistentStore.rms.RecordStore class. and remove references to it.api. 1. 14 .device. To remove individual data.microedition.microedition. Pass the following parameters: • a record ID • a byte array • an offset 2.lang. _data. and specify true to indicate that the method should create the record store if the record store does not exist.cod file that defines a PersistentStore. 2.addRecord(_data. 2. Import the following classes: • net. treat the data as normal objects.rms.system.microedition. Import the javax. providing as a parameter a unique key for the PersistentObject. int).rms. Retrieve a record from a record store 1. 3.

private Vector _contacts.RecordStore class. false).getContents(). private PersistentObject _persist.api. Import the following classes: • net.RecordFilter • javax. 4. the method returns the records in any order) • keepUpdated: determines if the method keeps the enumeration current with the changes to the record store RecordStore store = RecordStore. 3.system. 2. Invoke enumerateRecords().device.openRecordStore("Contacts".microedition.rms. 2. Import the following interfaces: • javax.SyncCollection interface.getRecord(id.getRecordSize(id)].RecordComparator Invoke openRecordStore().rms. data. Store the returned data in a vector object. Retrieve all records from a record store 1. null.rim. Create a method to provide the BlackBerry device application with the newest SyncCollection data before a wireless data backup session begins. _contacts = (Vector)_persist. 4.RecordEnumeration • javax.getPersistentObject() method using the ID of the SyncCollection.microedition. To provide the BlackBerry® device application with access to the newest SyncCollection data from the PersistentStore.microedition.rms. the method returns all records) • comparator: specifies a RecordComparator object to determine the order in which the method returns the records (if null. invoke the PersistentStore. private static final long PERSISTENT_KEY = 0x266babf899b20b56L. _persist = PersistentStore. 15 . Pass the following parameters: • filter: specifies a RecordFilter object to retrieve a subset of record store records (if null. 5.synchronization.Vector Import the net.getPersistentObject( PERSISTENT_KEY ).api. String dataString = new String(data). Import the javax.rim.PersistentStore • java. RecordEnumeration e = store.util.rms. store. 0).Development Guide Collections byte[] data = new byte[store.enumerateRecords(null. Collections Retrieve a collection from persistent storage 1.device. 3. false).microedition.

Development Guide

Collections

public void beginTransaction() { _persist = PersistentStore.getPersistentObject(PERSISTENT_KEY); _contacts = (Vector)_persist.getContents(); }

6.

Create code to manage the case where the SyncCollection you retrieve from the PersistentStore is empty.
if( _contacts == null ) { _contacts = new Vector(); _persist.setContents( _contacts ); _persist.commit(); }

Create a collection listener to notify the system when a collection changes
The system invokes CollectionEventSource.addCollectionListener() to create a CollectionListener for each SyncCollection the BlackBerry® device application makes available for wireless backup. 1. 2. Import the net.rim.device.api.util.ListenerUtilities class. Import the following interfaces: • java.util.Vector • net.rim.device.api.collection.CollectionEventSource • net.rim.device.api.collection.CollectionListener • net.rim.device.api.synchronization.SyncCollection Create a private vector object to store the collection of SyncCollection listeners for the BlackBerry device application.
private Vector _listeners; _listeners = new CloneableVector();

3.

4.

Implement the CollectionEventSource.addCollectionListener() method, making sure the method adds a CollectionListener to the Vector that contains listeners. In the following code sample, we implement CollectionEventSource.addCollectionListener() to invoke ListenerUtilities.fastAddListener() to add a listener to the Vector that contains listeners.
public void addCollectionListener(Object listener) { _listeners = ListenerUtilities.fastAddListener( _listeners, listener ); }

16

Development Guide

Remove a collection listener that notifies the system when a collection changes
When a CollectionListener is no longer required, the system invokes CollectionEventSource.removeCollectionListener. 1. Import the following classes: • net.rim.device.api.util.ListenerUtilities • java.util.Vector Import the following interfaces: • net.rim.device.api.collection.CollectionEventSource • net.rim.device.api.collection.CollectionListener Implement the following interfaces: • net.rim.device.api.collection.CollectionEventSource • net.rim.device.api.collection.CollectionListener Implement the CollectionEventSource.removeCollectionListener() method, using the ListenerUtilities.removeListener() method to remove a CollectionListener from the Vector that contains SyncCollection listeners for the BlackBerry® device application. In the following code sample, we implement CollectionEventSource.removeCollectionListener() to invoke ListenerUtilities.removeListener() to remove a listener from the Vector that contains listeners
public void removeCollectionListener(Object listener) {_listeners = ListenerUtilities.removeListener( _listeners, listener ); }

2.

3.

4.

Notify the system when a collection changes
1. 2. Import the net.rim.device.api.collection.CollectionListener interface. To notify the system when an element is added to a SyncCollection, invoke CollectionListener.elementAdded().
for( int i=0; i<_listeners.size(); i++ ) { CollectionListener cl = (CollectionListener)_listeners.elementAt( i ); cl.elementAdded( this, object ); } return true; }

3. 4.

To notify the system when an element in a SyncCollection is replaced, invoke CollectionListener.elementUpdated(). Invoke CollectionListener.elementRemoved().

17

Development Guide

Runtime storage

Runtime storage
BlackBerry® devices use a runtime store as a central location in which BlackBerry Java® Applications can share runtime objects. By default, only BlackBerry Java Applications that Research In Motion digitally signs can access data in the runtime store. Contact RIM for information about how to control access to your data. The runtime store is not persistent. When you restart the BlackBerry device, the data in the runtime store clears.

Retrieve the runtime store
1. 2. Import the net.rim.device.api.system.RuntimeStore class. Invoke RuntimeStore.getRuntimeStore().
RuntimeStore store = RuntimeStore.getRuntimeStore();

Add an object in the runtime store
1. Import the following classes: • net.rim.device.api.system.RuntimeStore • java.lang.String • java.lang.IllegalArgumentException Invoke RuntimeStore.put(long, String) and provide as parameters a unique long ID and the runtime object to store. Create a try - catch block to manage the IllegalArgumentException that put() throws if a runtime object with the same ID exists.
RuntimeStore store = RuntimeStore.getRuntimeStore(); String msg = "Some shared text"; long ID = 0x60ac754bc0867248L; try { store.put( ID, msg ); } catch(IllegalArgumentException e) { }

2. 3.

Replace an object in the runtime store
1. Import the following classes: • net.rim.device.api.system.RuntimeStore • java.lang.String • net.rim.device.api.system.ControlledAccessException Invoke replace(). Create a try - catch block to manage the ControlledAccessException that replace() throws if the runtime object with the specified ID does not exist.

2. 3.

18

getRuntimeStore().waitFor(0x60ac754bc0867248L).RuntimeStore • net. } catch(ControlledAccessException e) { } catch(RuntimeException e) { } 2. } catch(ControlledAccessException e) { } 2.device. 19 .waitFor() to wait for registration of a runtime object to complete.ControlledAccessException Invoke RuntimeStore. String newmsg = "Some new text". try { Object obj = store. Import the following classes: • net.device.api. 3.Development Guide Runtime storage RuntimeStore store = RuntimeStore. 3. Create a try .system.api.lang.device. RuntimeStore store = RuntimeStore.RuntimeException Invoke RuntimeStore. newmsg).get(0x60ac754bc0867248L).catch block to manage the ControlledAccessException that get() throws if the BlackBerry® Java® Application does not have read access to the specified runtime object. Import the following classes: • net.system.RuntimeStore • net.system.rim.ControlledAccessException • java.rim.system. try { Object obj = store.getRuntimeStore().rim. RuntimeStore store = RuntimeStore.rim. Retrieve an unregistered runtime object 1.replace( 0x60ac754bc0867248L. Create code to handle exceptions.get() and provide as a parameter the runtime object ID. } catch(ControlledAccessException e) { } not exist Retrieve a registered runtime object 1. try { Object obj = store.device.api.getRuntimeStore().api.

When you use the BlackBerry Enterprise Server as an intranet gateway.io. which makes the network request to the Internet through the firewall. CDMA or GPRS to open a wireless connection.transport. This process continues until a network connection is opened or the end of the list is reached.options packages. Organizations can set an IT policy to enforce the use of the BlackBerry Enterprise Server as the gateway for all wireless network traffic. and socket network connections by specifying a URL and an optional list of preferred transport types. Because the BlackBerry Enterprise Server is located behind the organization's firewall and provides inherent data encryption. in the specified order.transport and net. You can use the ConnectionFactory class to request a network connection. all available transport types are tried. BlackBerry devices that run BlackBerry® Device Software 5. If your application connects to the Internet rather than an organization's intranet. applications can communicate with application servers and web servers that reside on the organization's intranet.device. In this case. A BlackBerry device can work with different types of gateways and each gateway provides a unique set of configurable features. 20 .io. If you do not specify a transport type. You can specify the type of wireless connection and gateway to use.Development Guide Creating connections Creating connections Network connections and transport types 3 A BlackBerry®device can use various radio communication technologies such as Wi-Fi® technology. and tries to open a connection. You can use the methods that are provided in the TransportInfo class to check for available transport types and associated wireless coverage areas. The BlackBerry® Mobile Data System component of the BlackBerry Enterprise Server includes the BlackBerry® MDS Services.device. the Network API checks the availability and the wireless coverage area of each transport type. network requests travel behind an organization's firewall to the BlackBerry Enterprise Server. all data traffic between your application and the BlackBerry Enterprise Server is encrypted automatically using AES encryption or Triple DES encryption. you might be able to use the BlackBerry Enterprise Server that the device is associated with as a gateway. You can open HTTP. Most of the functionality of the Network API is implemented in the ConnectionFactory and TransportInfo classes. HTTPS.api. including traffic destined for the Internet.0 or later include a Network API that is designed to simplify how you open network connections and check the availability and the wireless coverage area of transport types. The wireless connection is transferred to a wired network and connected to an intranet or the Internet through a proxy or gateway. which provides an HTTP and TCP/IP proxy service to let third-party Java® applications use it as a highly secure gateway for managing HTTP and TCP/IP connections to the intranet.rim. If you specify a list of transport types.api. Using the BlackBerry Enterprise Server as an intranet gateway Organizations host the BlackBerry® Enterprise Server behind their firewall to allow BlackBerry device users to access the organization's intranet. All the Network API classes are provided in the net.rim.

device. this approach can often yield good results.system package to verify that the BlackBerry device is in wireless network coverage area. The BlackBerry® device must be connected to a wireless network for this method to work.String • net.String Import the following interfaces: • javax.rim. However. Connections Use HTTP authentication 1. Most wireless service providers provide their own Internet gateway that offers direct TCP/ IP connectivity to the Internet.rim.ui. String networkName = RadioInfo.StreamConnection Use the CoverageInfo class and CoverageStatusListener interface of the net.device.rim.Field Invoke RadioInfo.io.ui.api. Import the following classes: • net.rim.device. System. If you write your application for BlackBerry device users who are on a specific wireless network.UiApplication • net.RadioInfo • java.microedition.system. if you write your application for BlackBerry device users on a variety of wireless networks. In these scenarios.device. Import the following classes: • net.io. testing your application against the different Internet gateways and achieving a consistent and reliable experience can be challenging.out.rim.api.system. you may find it useful to use the BlackBerry® Internet Service.device.Development Guide Connections Using the wireless service provider's Internet gateway Java® applications for BlackBerry® devices can connect to the Internet using the Internet gateway that the wireless service provider provides. 3.component. 2. Java applications for BlackBerry devices can use either of these gateways to establish connections to the Internet.getCurrentNetworkName(). Some operators also provide a WAP gateway that lets HTTP connections occur over the WAP protocol.CoverageStatusListener • javax. 2.microedition.device.api. and use the wireless service provider’s Internet gateway as a default connection type if the BlackBerry Internet Service is not available.io.api.getCurrentNetworkName().api.Connector • net.rim.lang.rim.microedition.println (“Network Name: “ + networkName ).HttpConnection • net.Dialog • java. 21 .ui.device. Retrieve the wireless network name 1.api.lang.CoverageInfo • javax.api.system.

encode(login. false). To process the login information. HttpConnection httpConn = (HttpConnection)s.open("http://mysite.getUiApplication(). Invoke HttpConnection. s = (StreamConnection)Connector.getResponseCode().getResponseCode().open("http://mysite.txt "). httpConn. login. (Dialog. 9."Unauthorized Access:\n Do you wish to log in?"). 7. int status = httpConn. Invoke HTTPConnection.setRequestProperty("Authorization".txt").D_YES_NO. 22 . httpConn = (HttpConnection)s. false. 5. Cast and store the StreamConnection object as an HTTPConnection object. "Basic " + new String(encoded)). } } 10.Development Guide Connections 4. s. UiApplication.open(). Invoke Connector. 11.getBytes().length().com/ myProtectedFile. Retrieve the login information and close the current connection. 6. 8.setRequestProperty() using the encoded login information to access the protected resource.HTTP_UNAUTHORIZED). if (dialogResponse == Dialog. Create code to manage an unauthorized HTTP connection attempt. switch (status) case (HttpConnection.YES) {String login = "username:password". Cast and store the returned object as a StreamConnection. using the HTTP location of the protected resource. a. //Close the connection. create code to manage a Yes dialog response.ask. Create a run()method and within it implement a dialog object to ask the BlackBerry device user for login information. byte[] encoded = Base64OutputStream. b. StreamConnection s = (StreamConnection)Connector.invokeAndWait(new Runnable()) { public void run() { dialogResponse = Dialog.close(). int status = httpConn.com/myProtectedFile.getResponseCode(). Encode the login information. 0.

CoverageInfo • javax.device.Development Guide Connections Use an HTTPS connection If your BlackBerry device is associated with a BlackBerry® Enterprise Server and uses an HTTPS proxy server that requires authentication. To specify the connection mode.open(). Use a socket connection Although you can implement HTTP over a socket connection. Invoke Connector. 1.CoverageStatusListener • javax.io.system.system package to make sure that the BlackBerry device is in a wireless network coverage area. 2. HttpsConnection stream = (HttpsConnection)Connector.CoverageInfo • javax.microedition.io.api. HttpsConnection stream = (HttpsConnection)Connector. you should use an HTTP connection for the following reasons: • Socket connections do not support BlackBerry® Mobile Data System features.api.InputStreamReader 23 .open("https://host:443/"). such as push.device. add one of the following parameters to the connection string that passes to Connector.api.rim. Import the following classes: • net.system.rim. Import the following classes: • net.microedition.Connector Import the following interfaces: • net.HttpsConnection Use the CoverageInfo class and CoverageStatusListener interface of the net.io. • BlackBerry® device applications that use socket connections typically require significantly more bandwidth than BlackBerry device applications that use HTTP connections.Connector • java. 3.api. If the BlackBerry device does not support end-to-end TLS.open("https://host: 443/.rim.EndToEndDesired").system.rim.io.OutputStreamWriter • java.device. you will not be able to use end-to-end TLS.io. 1. then a proxy connection is used: EndToEndDesired. 5.microedition.device.open() • Specify that an end-to-end HTTPS connection must be used from the BlackBerry device to the target server: EndToEndRequired • Specify that an end-to-end HTTPS connection should be used from the BlackBerry device to the target server. specifying HTTPS as the protocol and cast the returned object as an HttpsConnection object to open an HTTP connection. and the BlackBerry device user permits proxy TLS connections. 4.String • java.lang.

private static String URL = "socket://local_machine_IP:4444. i < length. 0. InputStreamReader _in = new InputStreamReader(conn.close(). append deviceside=false to the end of the URL. Make sure that the BlackBerry device application implements exception handling. coverage area. ++i ) { input[i] = (char)_in. append the deviceside=true parameter to the end of the URL.open(). int length = data.write(data. length). StreamConnection conn = null.StreamConnection Use the CoverageInfo class and CoverageStatusListener interface of the net. conn = (StreamConnection)Connector. append the deviceside=true parameter to the end of the URL and specify the APN over which the connection will be made. OutputStreamWriter _out = new OutputStreamWriter(conn.system. for ( int i = 0.apn=internet. _in. 5. • To open a socket connection using BlackBerry MDS Services .com. • To open a socket connection over direct TCP.tunnelauthpassword=user165password".device. Import the following interfaces: • net.CoverageStatusListener • javax.rim.openOutputStream()).deviceside=false". 4. Specify the user name to connect to the APN.rim. 24 . _out.close(). String data = "This is a test".open(URL). Invoke Connector. private static String URL = "socket: //local_machine_IP:4444. and the password if required by the APN.microedition.Development Guide Connections 2.openInputStream()). StreamConnection conn = null. 6. conn.deviceside=true.device. Use openInputStream() and openOutputStream() to send and receive data.open(URL).system package to make sure that the BlackBerry device is in a wireless network 3.tunnelauthusername =user165. }. conn = (StreamConnection)Connector. conn = (StreamConnection)Connector. BlackBerry device applications must input their local machine IP explicitly because localhost is not supported. specifying socket as the protocol and appending the deviceside=false parameter to the end of the URL. private static String URL = "socket://local_machine_IP:4444. Invoke close() on the input and output streams and the socket connection. Each of the close() methods throws an IOException.close(). • To open a socket connection over direct TCP.length(). char[] input = new char[length]. StreamConnection conn = null.api.api.read(). specifying APN information.open(URL). _out.deviceside=true".io.

dest-port is the destination port at the host address (optional for receiving messages).lang. outDatagram. 7.system. To open a datagram connection on a non-GPRS network.api.CoverageStatusListener • javax.newDatagram().io.microedition.6343/.CoverageInfo • javax.io.setData(buf. buf.api. invoke Datagram.newDatagram(buf. Use a datagram connection to send and receive datagrams. host is the host address in dotted ASCII-decimal format.rim. Verify that your service provider supports UDP connections. Invoke Connector.api. omit the destination port in the connection string. where: • • • • 5. invoke DatagramConnection.microedition.system package to make sure that the BlackBerry device is in a wireless network coverage area. 1.0. To use a datagram connection.0:2332. 9. (DatagramConnection)Connector.io. you must have your own infrastructure to connect to the wireless network. You can send and receive datagrams on the same port. specify udp as the protocol and cast the returned object as a DatagramConnection object to open a datagram connection.Development Guide Connections Use a datagram connection Datagrams are independent packets of data that applications send over networks. specify the source port number.microedition. 2. Import the following classes and interfaces: • net. Datagram outDatagram = conn. 6.Datagram Use the CoverageInfo class and the CoverageStatusListener interface of the net. invoke send() on the datagram connection.open(). 8. A Datagram object is a wrapper for the array of bytes that is the payload of the datagram. the address for a CDMA network connection would be udp://121. byte[] buf = new byte[256]. To receive datagrams from all ports at the specified host.setData(). including the trailing slash mark. To create a datagram. 25 . Using UDP connections requires that you work closely with service providers.length). 4. src-port is the local source port (optional). apn is the network APN in string format.open("udp://host:dest_port[.device.system.String Import the following interfaces: • net.DatagramConnection • javax.For example. To add data to a diagram. buf. 3. including an APN for GPRS networks.rim.length).device.0.device.src_port]/apn"). To send data on the datagram connection.rim.Connector • java.

Invoke Connector. byte[] buf = new byte[256].String • java.writeChars(data).microedition.microedition.io.getData()). To receive data on the datgram connection. Make sure that the BlackBerry Java Application implements exception handling. The receive() method blocks other operations until it receives a data packet. conn.StreamConnection interface. an IOException is thrown.DataOutputStream • java.receive(inDatagram).stopbits=1"). convert the data to the appropriate format. private String data = "This is a test". 4.bitsperchar=8.Development Guide Connections conn.parity=none.open(). To send data on the USB or serial port connection. conn.io.openDataOutputStream().open( "comm:COM1. buf. This type of connection also lets BlackBerry device applications communicate with a peripheral device that plugs into the serial or USB port. 5. 1. private StreamConnection _conn = (StreamConnection)Connector. Datagram inDatagram = conn.lang. To extract data from a datagram. 26 . 12. String received = new String(inDatagram. invoke close() on the input and output streams.Connector • java. 10. 2. _dout.newDatagram(buf.io. invoke getData(). invoke receive() on the datagram connection.close().send(outDatagram). 11.DataInputStream Import the javax. and specify comm as the protocol and COM1 or USB as the port to open a USB or serial port connection. Use the write methods on the output stream to write data. Use a USB or serial port connection Using a serial or USB connection. . (). 3. Import the following classes: • javax. Use a timer to retransmit the request or close the connection if a reply does not arrive.io. Close the datagram connection. and on the datagram connection object. invoke openDataOutputStream() or openOutputStream DataOutputStream _dout = _conn. If a BlackBerry®Java® Application attempts to send a datagram on a datagram connection and the recipient is not listening on the specified source port. BlackBerry® device applications can communicate with desktop applications when they are connected to a computer using a serial or USB port.length). If you know the type of data that you are receiving.baudrate=9600.

getSerialPortInfo() returns as a parameter to open a Bluetooth connection. To send data on the Bluetooth connection. Invoke openInputStream() or openDataInputStream(). To receive data on the USB or serial port connection.DataInputStream • java. To close the USB or serial port connection.toString().readUTF().microedition.io.device.bluetooth) to let your BlackBerry® device application access the Bluetooth Serial Port Profile and initiate a server or client Bluetooth serial port connection to a computer or other Bluetooth enabled device. StreamConnection _bluetoothConnection = (StreamConnection)Connector. String contents = _din.bluetooth.api.getSerialPortInfo(). DataInputStream _din = _conn.StreamConnection interface. _dout.io. To receive data on the Bluetooth connection.io. in a non-main event thread.open( info [0].api. 6. _dout.close(). Use a Bluetooth serial port connection You can use the Bluetooth® API (net. 5. 3. invoke close() on the input and output streams. Import the following classes: • javax.openDataOutputStream().DataOutputStream • java.Connector • net.open().IOException Import the javax.io.READ_WRITE ). Use the read methods on the input stream to read data.device. BluetoothSerialPortInfo[] info = BluetoothSerialPort.String • java. conn.close(). 2.lang. _din. 4. Use the read methods on the input stream to read the data. use a non-main event thread to read data from the input stream.close().microedition.writeInt(JUST_OPEN). invoke openInputStream() or openDataInputStream(). Invoke Connector. providing the serial port information that BluetoothSerialPort. and on the port connection object. DataOutputStream _dout = _bluetoothConnection.Development Guide Connections 6.rim. invoke openDataOutputStream() or openOutputStream().rim.openInputStream(). private static final int JUST_OPEN = 4. The close() method can throw IOExceptions. 1. Use the write methods on the output stream to write data.BluetoothSerialPort • java. Use the read methods on the input stream to read data. Connector. Make sure the BlackBerry device application implements exception handling. 7. 8.io. 27 .

GERAN.close().11™.close().11b™. EDGE. } catch(IOException ioe) { } } if (_din != null) { try { _din. Wireless access family 3GPP CDMA WLAN Description includes GPRS.openDataInputStream(). and GAN includes CDMA1x and EVDO includes 802. and on the Bluetooth serial port connection object to close the Bluetooth connection. Wi-Fi connections Wireless access families Working with the BlackBerry® device transceiver involves using APIs that make reference to wireless access families. _din = null. _dout = null.close().readUTF(). UMTS®. The close() method can throw IOExceptions.11a™. 802. Make sure the BlackBerry device application implements exception handling. 802.Development Guide Wi-Fi connections DataInputStream _din = _bluetoothConnection. UTRAN. String contents = _din. if (_bluetoothConnection != null) { try { _bluetoothConnection. see the API reference for the BlackBerry® Java® Development Environment 28 .11g™ For more information about wireless access families. 802. Invoke close()on the input and output streams. } catch(IOException ioe) { } } _bluetoothConnection = null. 7. } catch(IOException ioe) { } } if (_dout != null) { try { _dout.

device. Import the net.system.rim.Development Guide Wi-Fi connections Retrieve the wireless access families that a BlackBerry device supports 1.getActiveWAFs() & RadioInfo.WLANInfo class. Import the net.api.system. 2. Turn off the transceiver for a wireless access family 1. Invoke RadioInfo.getActiveWAFs().api.api.device. 2. Invoke Radio. The WAFs parameter is a bitmask.Radio class.device.RadioInfo class.device.system.api.WLAN_STATE_CONNECTED and the value returned by WLANInfo. Import the net. Turn on the transceiver for a wireless access family 1.activateWAFs(int WAFs).system.WAF_WLAN and the value returned by RadioInfo. Import the net. 2.system.deactivateWAFs(int WAFs).RadioInfo class. 2. Import the net.api.getSupportedWAFs(). 2.device.system. this method returns WLANInfo. Invoke RadioInfo. if ( ( RadioInfo.rim.device. 2.getWLANState() method checks if a BlackBerry® device has an IP address and can transfer data over a Wi-Fi® network. Determine the wireless access family transceivers that are turned on 1.areWAFsSupported(int wafs).system. Create an IF statement that tests the value of WLANInfo. If the transceiver for the WLAN wireless access family is off.RadioInfo class.rim. Invoke RadioInfo.api.device. Import the net.api.rim. 2.rim.WAF_WLAN ) != 0 ) { … } Check if the Wi-Fi transceiver is connected to a wireless access point 1.getWLANState(). Determine if a BlackBerry device supports multiple wireless access families 1. Invoke Radio.rim. Import the net.rim.getActiveWAFs(). Create an IF statement that tests the value of RadioInfo. Check if the Wi-Fi transceiver is turned on 1.RadioInfo class. The WLANInfo. The WAFs parameter is a bitmask.Radio class. 29 .WLAN_STATE_DISCONNECTED.

system.io. the wireless service provider must support Wi-Fi access.microedition. 802.Connector Import the javax.rim. 1.WLAN_STATE_CONNECTED) {…} Retrieve the status of the wireless access point or the active Wi-Fi profile You can let a BlackBerry® device application retrieve status information such as the data rate of the connection.getCurrentNetworkName().String • net.api. or 802.RadioInfo • java.String • javax.Development Guide Wi-Fi connections if (WLANInfo. WLANInfo. The BlackBerry® device must be connected to a wireless network for this method to work.StreamConnection interface.11g™). and append the deviceside=true parameter and the interface=wifi parameter to the end of the URL string value. System. 2. 2.WLANAPInfo info = WLANInfo.getAPInfo().api.getWLANState() == WLANInfo. String networkName = RadioInfo. 1.out.11a™. Invoke Connector. 3. If the BlackBerry device is not connected to an access point. Import the following classes: • java. The WLANInfo. Invoke WLANInfo. 2.WLANInfo class.open(URL). the SSID of the associated access point.getAPInfo(). the WLANInfo.deviceside=true.lang.WLANAPInfo object contains a snapshot of the current wireless network.device.rim. specify socket as the protocol. StreamConnection conn = null.interface=wifi".rim.lang. Import the net.microedition. the wireless LAN standards used (802.11b™. Retrieve the wireless network name 1.println (“Network Name: “ + networkName ). private static String URL = "socket://local_machine_IP: 4444.getAPInfo() method returns null.open().system. Import the following classes: • net.device. Open a Wi-Fi socket connection The interface=wifi parameter applies only to TCP/UDP connections.Field Invoke RadioInfo.WLANAPInfo that this method returns. To establish a Wi-Fi® connection and use a Wi-Fi API in a BlackBerry® device application.ui. 30 . conn = (StreamConnection)Connector.device.getCurrentNetworkName().api. storing a reference to WLANInfo. or the name of the Wi-Fi profile in use. The transceiver for the WLAN wireless access family must be connected to a wireless access point.io.

open(URL).myServer.Development Guide Enhanced Network API Open a Wi-Fi HTTP connection The interface=wifi parameter applies only to TCP/UDP connections.rim.io. HttpConnection conn = null.String • javax.deviceside=true.Connector Import the javax.io. and append the interface=wifi parameter to the end of the URL string value. 3.microedition. conn = (HttpsConnection)Connector. and append the interface=wifi parameter to the end of the URL string value.open(URL).io. String URL = "https://host:443/.device. Enhanced Network API You can specify how your application opens a connection to a wireless network by using the enhanced Network API that is provided in the net. Import the following classes: • java.deviceside=true. The Network API simplifies how your application establishes a connection to a wireless network and enables you to find the wireless transport types available on the BlackBerry® device. 4. 3. 2. String URL = "http://www.options packages.interface=wifi".transport and net.lang.transport.open(). 1. For example.api.api. 4.rim.open().microedition. Open a Wi-Fi HTTPS connection The interface=wifi parameter applies only to TCP/UDP connections. To establish a Wi-Fi® connection and use a Wi-Fi API in a BlackBerry® device application.microedition. Invoke Connector. you can use the Network API to find the availability and signal strength of a Wi-Fi® network that your application can use to open an HTTP connection. conn = (HttpConnection)Connector. 1. specify https as the protocol. HttpsConnection conn = null. Invoke Connector. 2.lang. Import the following classes: • java.HttpsConnection interface.com/myContent. the wireless service provider must support Wi-Fi access. To establish a Wi-Fi® connection and use a Wi-Fi API in a BlackBerry® device application. Cast the returned object as an HttpConnection or a StreamConnection object.interface=wifi". specify http as the protocol.microedition. Cast the returned object as an HttpsConnection object.io.Connector Import the javax.String • javax.io.HttpConnection interface. 31 .io.device. the wireless service provider must support Wi-Fi access.

device. For more information about the Network API.api. you can have your application search for other transport types. public static void main(String[] args) { DisplayAvailableTransportTypes theApp = new DisplayAvailableTransportTypes().java * * Research In Motion Limited proprietary and confidential * Copyright Research In Motion Limited. For example. such as a cellular network. StringBuffer sbTmp = new StringBuffer("").container.*.rim. import net. import net. 32 pushScreen(new DisplayAvailableTransportTypesScreen()).ui.api. public DisplayAvailableTransportTypesScreen() { LabelField title = new LabelField("Transport Types Sample".rim. import net.component. public class DisplayAvailableTransportTypes extends UiApplication { public static RichTextField _message = new RichTextField("").Development Guide Enhanced Network API You can use the Network API to specify a preferred list of wireless transport types. Code sample: Displaying available transport types /* * DisplayAvailableTransportTypesScreen. If you do not specify a transport type.device.rim.io.ui.enterEventDispatcher(). theApp. setTitle(title). see the BlackBerry Java Application Development Guide and the API reference for the BlackBerry® Java® Development Environment. .USE_ALL_WIDTH). by default the BlackBerry device searches for all available transport types.*. int TransportTypes[] = TransportInfo.ELLIPSIS | LabelField.transport.ui.*.lang. } public DisplayAvailableTransportTypes() { } } class DisplayAvailableTransportTypesScreen extends MainScreen { private RichTextField strMessage = new RichTextField("").rim. LabelField.getAvailableTransportTypes().device. add(new RichTextField("Detected the following transport types:\n")). 2009 */ import net.api.StringBuffer.*. if a Wi-Fi network is not available or does not have sufficient signal strength.device. import java.api.

rim. } } Code sample: Creating a connection over HTTP by using the first available transport /* * HTTPFirstAvailable. theApp. 2010 */ import net.ui. import net. i++) { int tt = TransportTypes[i].*. case TransportInfo. break.TRANSPORT_TCP_WIFI: sbTmp.TRANSPORT_TCP_CELLULAR: sbTmp.rim.0 or 1.container.append(" BIS-B\n").*.Development Guide Enhanced Network API for(int i=0.io.device.*.append("* WAP 1.append("* MDS\n"). 33 .1\n").0\n").io. break.TRANSPORT_BIS_B: sbTmp.setText(sbTmp.device. case TransportInfo.api.device.io.ui.component.*. import net. case TransportInfo.rim. import javax. public class HTTPFirstAvailable extends UiApplication { public static void main(String[] args) { HTTPFirstAvailable theApp = new HTTPFirstAvailable().ui. break. add(strMessage). break. import java.length.TRANSPORT_WAP: sbTmp. case TransportInfo.java * * Research In Motion Limited proprietary and confidential * Copyright Research In Motion Limited.*. import net.append("* TCP Cellular\n"). break. case TransportInfo.TRANSPORT_WAP2: sbTmp.append("* WAP 2.append("* Wifi\n").microedition.TRANSPORT_MDS: sbTmp.api.enterEventDispatcher().device.api.api.toString()).rim. i<TransportTypes.transport. switch(tt) { case TransportInfo. break. } } strMessage.*.

connDesc = connFact.println("Caught IOException: " + e.getUiApplication().invokeLater(new Runnable() { public void run() { Dialog. add(new RichTextField("Trying to make HTTP connection.getConnection("http://www. httpConn = (HttpConnection)connDesc. } } } } class HTTPFirstAvailableScreen extends MainScreen { public HTTPFirstAvailableScreen() { setTitle("HTTP First Sample"). } }). ct.example. } } 34 . \n")). ConnectionDescriptor connDesc.err. UiApplication.. ConnectionThread ct = new ConnectionThread(). } } class ConnectionThread extends Thread { public void run() { ConnectionFactory connFact = new ConnectionFactory()..toString(iResponseCode)). try { final int iResponseCode = httpConn.alert("Response code: " + Integer.start().getResponseCode().Development Guide Enhanced Network API } public HTTPFirstAvailable() { pushScreen(new HTTPFirstAvailableScreen()).getMessage()). if (connDesc != null) { HttpConnection httpConn.com").getConnection(). } catch (IOException e) { System.

field net.api.api.notification net.api.api.rim.rim.invoke net. and BlackBerry Cryptography APIs.api.rim.rim.blackberry.browser.menuitem net.rim.device.pdap net.api.api.api. Java APIs with controlled access RIM controls Runtime APIs.device.api. before you can load the BlackBerry device application .blackberry. You can test BlackBerry device applications that use controlled APIs in the BlackBerry® Smartphone Simulator without code signatures.device. BlackBerry® Application APIs.blackberry.system 35 .api.phone. Locate the item in the API reference for the BlackBerry Java Development Environment.Development Guide Controlling access to APIs and application data Controlling access to APIs and application data Check if a code signature is required 4 Research In Motion tracks the use of sensitive APIs in the BlackBerry® Java® Development Environment for security and export control reasons.rim.options net.blackberry.device. If the item has a lock icon or is noted as ‘signed’ your BlackBerry device application requires a signed key or signature. your BlackBerry device application requires code signatures before you can load it onto a BlackBerry device: • • • • • • • • • • • • • • • • • net.api.cod files onto a BlackBerry device.api.blackberry.rim.event net.rim.mail net.browser.device. If you use any of the following BlackBerry API packages.servicebook net. which RIM provides.device.http net.blackberry.phone net.rim.device.rim.synchronization net.rim.crypto net.phonelogs net.mail.api.rim.blackberry.device.blackberry.rim.api.rim.rim.blackberry.browser net.plugin net. however.api.rim. you must obtain code signatures from RIM before you can load the BlackBerry device applications onto BlackBerry devices.rim.api.api.io.

csi file. 2. Click OK.csi file or the Client PIN and you are an ISV partner.com/SignedKeys/. Although an administrator can permit an infinite number of requests. contact RIM immediately. If you are not an ISV partner. Move your mouse to generate data for a new private key. contact your administrator.csi file that Research In Motion sends to you in an email message. . you must apply for a new . contact your ISV Technical Partnership Manager.csi file contains a list of signatures and your registration information. and type it again to confirm. Save the . proceed to step 9. 10. 5.blackberry. 1.csi file.Development Guide Register to use controlled APIs Register to use controlled APIs Complete the registration form at https://www. the number of requests is often specified to be a finite number for security reasons. 4. type the private key password. If the BlackBerry® Signing Authority Tool administrator does not provide you with the . Click Register. Click Exit.csi file becomes invalid. 6. expiry date 36 . Click Yes to create a new key pair file. you must register again with RIM. send an email message to jde@rim. If a dialog box appears that states that a private key cannot be found.csi file. The private key password protects your private key.csi file. 7. 8. Double-click the .csi file.com. type a password of at least eight characters. When you reach the maximum number of requests.csi file. In the Private Key Password field. This restriction specifies the expiry date for your . To request changes to these restrictions. Restrictions on code signatures The BlackBerry® Signing Authority Tool administrator might place restrictions on your . you must apply for a new .csi file to limit your access to code signatures. complete steps 5 to 8 before you continue. the . In the Registration PIN field. Otherwise. After the expiry date. 12. type the PIN that RIM provided. If this password is stolen. you can no longer apply for code signatures with this . In the Private Key Password field. The . 9. If you lose this password.csi file restriction number of requests Description This restriction specifies the maximum number of requests you can make using a particular . To make new signature requests. 3. 11. To make new code signature requests.

proxyHost: The name or IP address of the proxy server.csi file from Research In Motion. 3.csi) file. The BlackBerry Signature Tool uses the private key password to append the signature to the request.csi file that you want to register. 1.0\bin Type Java -jar -Dhttp. 1. Before you begin: You must obtain a . Use the following naming conventions for the keys: • • client-RRT-*. Repeat steps 1 through 3 for each . click Request.6.0 Password Based Administrator Guide. On the BlackBerry Signature Tool menu.cod file. 37 .cod files that you want permission to access and are requesting signatures for. locate the .csi. Make sure that a .Development Guide Request a code signature Request a code signature The BlackBerry® Signature Tool is included in the BlackBerry® Java® Development Environment. and it sends the signature list of .jar SigKey. 7. 4. In the dialog box.cod file that you want to add to the signature list. Register a signature key using a proxy server You can register each .com -Dhttp.csi with the following parameters: • SigKey: The name of each signature key (.blackberry. Repeat step 2 for each . type your private key password.csi. see the BlackBerry Signing Authority Tool version 1. The Web Signer application is installed when you install the BlackBerry® Signing Authority Tool. 6. The signature list contains information on the .proxyHost=myproxy.cod file exists in the same folder as the .csi. client-RBB-*. client-RCR-*. 2.csl file with the same name as the . The BlackBerry JDE is available for download at http://www. 2. At the command prompt.proxyPort: The proxy server port number if you do not specify 80 as the default port number. 5.cod file to add it to the signature list.proxyPort=80 SignatureTool. navigate to the BlackBerry® Signature Tool bin directory. For more information about the Web Signer application.com/developers. Dhttp. In Windows® Internet Explorer®.cod files to the Web Signer application for verification. The BlackBerry® Integrated Development Environment compiler automatically generates the .csl file.cod file for the BlackBerry device application for which you are requesting a signature. 3. Dhttp. Click OK. For example: C:\Program Files\Research In Motion\BlackBerry JDE 4. Double-click the .csi file only once.

contact your ISV Technical Partnership Manager. in the BlackBerry® Integrated Development Environment. Perform one of the following tasks: 38 .cod file(s) to sign. 1. After you receive an internal key. 2. open the project that contains the APIs that you want to control access to. and protect data in a persistent object. If you lose the registration key or the . select the . Start the BlackBerry® Signature Tool. you must apply protection to sensitive APIs. Select a . If you are a non ISV partner. 4. Click Add File to Project. For example: C:\Program Files\Research In Motion\BlackBerry JDE 4.Development Guide Sign an application using a proxy server Sign an application using a proxy server Your registration key and .csk file are stored together.proxyPort=80 SignatureTool. For files the Web Signer has signed.key is an external key. In the Workspace window. you cannot request code signatures. 1. the Status column contains Signed.com. Protect APIs using code signing keys 1.key file is saved. or an external key pair to use with an external signing authority system. 2. 3. or both keys.com -Dhttp.key is an internal key. 5. 4. 2. In the Look In field. and ACMI.cod file because the private key password was typed incorrectly. 3. If you are not an ISV partner. browse to C:\Program Files\Research In Motion\BlackBerry Password Based Code Signing Authority\data or the location where the . View the Status column. Using keys to protect APIs and data To create an internal key pair to use with an internal signing authority system. The Web Signer might have rejected the . right-click the project file. The RSAE.cod file.csk file. the Status column contains Failed. 3. Click Open. navigate to the BlackBerry® Signature Tool bin directory. an external key.6. At the command prompt.jar In the File Selection window. protect data in the runtime store. send an email message to jde@rim.proxyHost=myproxy. View the signature status for an application For files that are not signed.0\bin Type Java -jar -Dhttp.

Development Guide Protect runtime store data using code signing keys Option Description a. Use an internal key Use an external key a. the ACMI.key file. 3. providing as parameters the hash ID for the object and the CodeSigningKey object.key file. Select the Use as default for public classes option and Use as default for non-public classes settings.system. In the Look In field. c.key file.device.util. for example. Store the object in the runtime store and protect the object with the CodeSigningKey object. Click Ok.Hashtable • net. 7. h. Click Open. f. double click the . g. Click Add File to Project. 39 .api. e. d.rim. 4. Select the internal . Protect runtime store data using code signing keys 1. In the Packages and classes protection window.put( MY_DATA_ID. Expand the package contents. new ControlledAccess( myHashtable. Make sure that the object is protected with a particular code signing key. Select each API element that requires access control. e.key file. Import the following classes: • java. browse to C:\Program Files \Research In Motion\BlackBerry Password Based Code Signing Authority\data.get. b. Hashtable myHashtable = new Hashtable().RuntimeStore Create a hash ID for the object you want to store in the runtime store. key ) ). In the Workspace window. for example. 2. invoke RuntimeStore.key file. Select the external . Click OK. c. long MY_DATA_ID = 0x33abf322367f9018L. right-click the project file. d. 6. Only applications signed with the key can read or change the object. In the Workspace window. Re-compile the project. b. RuntimeStore. Click Open. find the name of the package that contains the sensitive API items. the RSAE.

3. Import the following classes: • java.Hashtable • net. invoke getContents using the CodeSigningKey object as a parameter.device.Development Guide Protect persistent data using code signing keys Protect persistent data using code signing keys 1.system.getContents( key ).api. key ) ). Make sure that the object is protected. 2. Hashtable myHashtable = new Hashtable().PersistentObject Create a hash ID for the object you want to store in a persistent object.setContents( new ControlledAccess( myHashtable. Hashtable myHashtable = (Hashtable) persistentObject.util. after a BlackBerry device application runs the following line of code. long MY_DATA_ID = 0x33abf322367f9018L. only code files that are signed with the RSAE .rim. 40 . 4. persistentObject. For example.key file can read or overwrite the object in the persistent object. Store the object in the persistent object and protect the object with the CodeSigningKey object.

performs preverification. the BlackBerry IDE creates a .cod file that contains sibling .jad) file RIM-COD-Module-Dependencies attribute. you might need code signing keys. or other issues that are difficult to simulate. To identify modules that a BlackBerry device application requires. visit http://www.jad file for a BlackBerry® device application. If your application uses signed APIs. To download additional versions of the BlackBerry Smartphone Simulator. Testing applications on a BlackBerry device After you test your application on the BlackBerry® Smartphone Simulator.cod files When you build a project using the BlackBerry® Integrated Development Environment. 41 .Development Guide Testing a BlackBerry device application Testing a BlackBerry device application Testing applications on a BlackBerry Smartphone Simulator 5 After you develop and compile your application. Any . The BlackBerry JDE includes current versions of the BlackBerry Smartphone Simulator. After you install the application on the BlackBerry device.cod files. but are not provided with it. you can install your application on a BlackBerry device.cod files. For debugging purposes.cod files within the original .blackberry.cod file that contains sibling .cod file contains sibling . so the BlackBerry Smartphone Simulator provides an accurate environment for testing how applications will function on a BlackBerry device.com/developers/index. extract the contents of the . Testing applications using the compiled . To determine if a . you can open the application and test its functionality and performance.cod files. Only the BlackBerry® Browser supports wireless installation of a . you can attach your device to the BlackBerry® Integrated Development Environment and use the debugging tool to step through your application code. examine the Java® application descriptor (. If a BlackBerry device application contains more than 64 KB of bytecode or resource data.cod file are the sibling files. The BlackBerry Smartphone Simulator runs the same Java code as the BlackBerry devices.cod file.shtml. The most common first step is to set the BlackBerry® Java® Development Environment to use a BlackBerry® Smartphone Simulator. and creates a single .cod file and . The BlackBerry IDE can be useful if you are trying to identify a network or Bluetooth® issue. you can test it on the BlackBerry® device. the BlackBerry IDE compiles your source files into Java® bytecode.

use the JavaLoader tool. Perform one of the following actions: 42 . Open a command prompt and navigate to the location of the JavaLoader.cod file from a device to a computer To load. 1. 1.cod files when testing a BlackBerry® device application.cod files when testing a BlackBerry® device application.cod file To load.exe file. Save BlackBerry device Issue a command using the following format: javaloader save application .cod file before loading the project A .cod file BlackBerry device to your For example: javaloader.jad file same . Open a command prompt.cod file. 2. For production applications. You must load BlackBerry device applications with dependencies in the correct order. Connect the BlackBerry device to the computer. included with the BlackBerry® Java® Development Environment.cod files Install and remove a .jad device to your computer. use the JavaLoader tool.cod computer.exe save MyApplication. use the BlackBerry® Desktop Software.cod files when testing a BlackBerry® device application.jad file from the BlackBerry For example: javaloader.exe save MyApplication. Save a .cod file from the . Retrieve information about a .cod files stored in the [-g] module same CodeModuleGroup from the For example: javaloader. use the JavaLoader tool. remove. 3. remove. 2. Save BlackBerry device Issue a command using the following format: javaloader save application . load the project B .cod files listed in the . Perform one of the following actions: Task Steps Save a BlackBerry device Issue a command using the following format: javaloader save application . 3.cod file for testing To load.Development Guide Testing applications using the compiled . Connect the BlackBerry® device to the computer. or save .exe save -g MyApplication BlackBerry device to your computer. included with the BlackBerry® Java® Development Environment. or save . or save . included with the BlackBerry® Java® Development Environment . If project A is dependent on project B. and navigate to the location of the JavaLoader.exe file. remove.

cod file Steps Issue a command using the following format: javaloader info .cod file.cod files Task Retrieve the Name. Retrieve information on • • • • • • sibling .cod Issue a command using the following format:javaloader info [-v] .cod files that a . Version.cod file For example: javaloader.cod Issue a command using the following format: javaloader info [-d] .Development Guide Testing applications using the compiled .cod file requires to run.cod file For example: javaloader.exe info -d MyApplication.exe info MyApplication. and Date created information for a .cod 43 .cod file For example: javaloader. Size. Retrieve a list of .cod files size of code section size of data section size of initialized data number of class definitions list of signatures applied to a .exe info -v MyApplication.

The browser prompts the users to install the application and then the application downloads over the wireless network and installs on the BlackBerry device. Wireless pull (user-initiated) You can post compiled applications on a public or private web site. directory Application distribution over the wireless network You can distribute your applications over the wireless network to help provide a better experience to BlackBerry® device users and to simplify application distribution to a large group of people since you do not require a computer application. the administrator can push applications to BlackBerry device users over the wireless network for mandatory installation. 44 . partially verify your classes. Organizations might find this approach useful when sending new applications to a large number of BlackBerry device users.exe [-d] output -classpath directory input. A BlackBerry device user can install your applications over the wireless network.cod files.Development Guide Packaging and distributing a BlackBerry Java Application Packaging and distributing a BlackBerry Java Application Preverify a BlackBerry device application 6 To reduce the amount of processing the BlackBerry® device performs when you load your BlackBerry device application. Wireless push (server-initiated) In the BlackBerry® Enterprise Server environment . BlackBerry® device users can visit the web site to download the applications over the wireless network by using the browser on their BlackBerry devices. At the command prompt. The administrator creates a new policy and specifies that the BlackBerry device requires the application. You may also use the BlackBerry® Smartphone Simulator to preverify . type: preverify. The application is pushed to users without any user interaction required.

cod file. 5. Give each sibling . To ensure a BlackBerry® device user does not override the original . Use the following naming convention for sibling . and place the name of the sibling file to the right of this parameter.cod RIM-COD-Size: 55000 RIM-COD-URL-1: myApp-1.0 RIM-COD-Module-Name: MyApp MIDlet-Name: My Application RIM-COD-URL: myApp. list the sibling . 1.cod file.cod file and extract the sibling .cod files: name of original . In the . Create a RIM-COD-Size-<#> parameter for each sibling .0 MIDlet-Version: 1. followed by -<#>.cod files.cod files separately. # is the same number that is appended to the name of the sibling file..cod file.cod and myApp-2. on the content server.jad file. Place the RIMCOD-Size-<#> parameter immediately below the RIM-COD=URL-<#> parameter.cod files. The developer creates a RIM-CODSize-<#> parameter for each sibling file.0. Example: Listing sibling .sequential number.jad files and perform the following actions: 45 .jad file The following example contains two sibling files named myApp-1.cod file on a content server.cod file.cod RIM-COD-Size-2: 25000 MicroEdition-Profile: MIDP-1. Place each sibling .cod’ file extension to each sibling file name.cod files in a . and place the size of the sibling file to the right of this parameter.0 Modifying information for a MIDlet suite You can use the Updatejad tool. Unzip the original . The developer appends the ‘. RIM-COD-Module-Dependencies: net_rim_cldc MicroEdition-Configuration: CLDC-1. # is a number that starts at 1 and increases by 1 for each sibling file.cod file myAPP.0 MIDlet-1: .cod RIM-COD-Size-1: 50000 RIM-COD-URL-2: myApp-2. 4.cod files the same name as the original . Manifest-Version: 1. extract the sibling .cod files into a different directory than the directory where the original file exists. 2. part of the BlackBerry® Java® Development Environment. to process .cod file . after the original . 3.Development Guide Distributing BlackBerry Java Applications over the wireless network Distributing BlackBerry Java Applications over the wireless network Extract sibling .cod. Create a RIM-COD-URL-<#> parameter for each sibling .

jad file to update. Required RIM attribute RIM-COD-Creation-Time RIM-COD-Module-Dependencies RIM-COD-Module-Name RIM-COD-SHA1 RIM-COD-Size RIM-COD-URL Description creation time of the .cod file list of modules that the .cod file can be loaded Description reserved for use by Research In Motion reserved for use by RIM name of the resource bundle on which the BlackBerry device application depends Optional RIM attribute RIM-Library-Flags RIM-MIDlet-Flags RIM-MIDlet-NameResourceBundle 46 .cod files. on other wireless devices. This option suppresses the backup of the original . download the .jad files created using the BlackBerry® Integrated Development Environment or the RAPC command-line tool.cod files.jad file change after you use the BlackBerry® Signing Authority Tool to sign .cod file sizes listed in a . Properties of BlackBerry device application . download the . The Updatejad tool commands have the following format: updatejad.jar files. This option specifies other attributes to add to the input. If an error occurs during .jad [additional.exe -q -n input.Password Based Administrator Guide.jad file.jad files The BlackBerry® Integrated Development Environment lets you create a dual-purpose . see the BlackBerry Integrated Development Environment Help or the BlackBerry Signing Authority Tool version 1.jad additional. To do this.jad Description This option suppresses the creation of success output messages for . On BlackBerry devices.jad file that contains both the RIM-COD-URL and RIM-COD-Size attributes and the MIDlet-Jar-URL and MIDlet-Jar-Size attributes.jad files that reference multiple .jad file processing operations.cod file sizes listed in the .jad file to support the downloading of MIDlets onto BlackBerry devices and other wireless devices. For more information.0 .cod files.Development Guide Distributing BlackBerry Java Applications over the wireless network • • Correct the . and signed using the BlackBerry Signing Authority Tool .jad file. Create .cod file URL from which the .cod file size (in bytes) of the . The .jad file processing.cod file contains SHA1 hash of the . create a . a nonzero exit code is produced.jad] Option -q -n input. This option specifies the . Use the Updatejad tool only on .jad file.cod file requires name of the module that the .

test.cod and test.jad Create . 3.jad file to the new one.jad. 2.cod and test. updatejad. 6. navigate to the location of the Updatejad tool.jad file. 5. From a command-prompt.cod and lib.cod file sizes listed in a .cod file. Use the BlackBerry IDE to create two other BlackBerry device application files that use the . Type a command to correct the .cod file.Development Guide Distributing BlackBerry device applications with the BlackBerry Desktop Software Optional RIM attribute RIM-MIDlet-Position Description suggested position of the BlackBerry device application icon on the Home screen might not be the actual position of the icon on the Home screen Correct the .alx file Element application Attributes id platformVersion blackBerryVersion Description The application element contains the elements for a single BlackBerry® device application. Use the BlackBerry® Signing Authority Tool to sign the . test. for example. updatejad. for example.cod file names from the first .cod file sizes listed in test.jad file.exe test. 1. lib.jad Distributing BlackBerry device applications with the BlackBerry Desktop Software Elements in BlackBerry device application .exe test. Use the BlackBerry® Integrated Development Environment to create two BlackBerry® device application files.jad lib.cod file. for example. navigate to the location of the Updatejad tool. Use the BlackBerry Signing Authority Tool to sign the new .cod files. 1. 2. From a command-prompt. Use the BlackBerry® Signing Authority Tool to sign the . Type a command to add the . Use the BlackBerry® Integrated Development Environment to create two BlackBerry® device application files.jad.jad.jad files that reference multiple . 4. 3.jad. 4. 47 .

The directory element provides the location of a set of files.alx location> \MyCodFiles b.0"> <files> a. If you do not specify a directory. its prerequisite modules are also loaded on the BlackBerry device. which appears in the application loader tool of the BlackBerry® Desktop Manager. Nesting lets you require that.helloworld. The copyright element provides copyright information. To provide uniqueness. com.app"> <directory>MyCodFiles</directory> <fileset Java="1. directory elements are cumulative within a BlackBerry copyright — description — directory platformVersion blackBerryVersion device application. which appears in the application loader tool of the BlackBerry Desktop Manager.cod //resolves to <. when a BlackBerry device application is loaded on the BlackBerry device.Development Guide Distributing BlackBerry device applications with the BlackBerry Desktop Software Element Attributes Description The application element can also contain additional nested application elements. The id attribute specifies a unique identifier for the BlackBerry device application. The directory element specifies the directory relative to the location of the .cod </files> </fileset> <directory>MyCodFiles</directory> <fileset Java="1.alx file. The description element provides a brief description of the BlackBerry device application. docs. The blackBerryVersion attribute specifies the version of the BlackBerry® Device Software that a BlackBerry device application requires. use an ID that includes your company domain in reverse order.alx file.samples. For example.abc. the files must exist in the same location as the . The platformVersion attribute specifies the version of the operating system software on a BlackBerry device that a BlackBerry device application requires.rim.0"> 48 .my. The directory element is optional. For example: <application id="com.

The colour attribute lets you load different BlackBerry device applications or modules for color or monochrome displays. The value is a Boolean. include one or more fileset elements in the . The files element provides a list of one or more BlackBerry device application . The Java attribute specifies the minimum version of the BlackBerry® Java® Virtual Machine with which the . Possible values include Mobitex. The radio attribute lets you load different BlackBerry device applications or modules on the BlackBerry device depending on the network type of the BlackBerry device. The langid attribute is optional. and 0x000c (French). 0x000a (Spanish). The blackBerryVersion attribute specifies the version of the BlackBerry Device Software that a BlackBerry device application requires. 49 files — fileset Java radio langid Colour platformVersion blackBerryVersion .cod </files> </fileset> </application> The platformVersion attribute specifies the version of the operating system software on a BlackBerry device that a BlackBerry device application requires. CDMA. The langid attribute lets you load different BlackBerry device applications or modules depending on the language support that BlackBerry device users add to the BlackBerry device. to load onto the BlackBerry device. for example: 0x0009 (English). To load files from more than one directory.cod files. 0x0007 (German).cod //resolves to <. in a single directory. and IDEN. The value is a Win32 langid code.cod files are compatible. true means color display and false means monochrome. The Java attribute is required. to load on the BlackBerry device.alx file. It specifies a set of .alx location> \MyCodFiles\MyCodFiles d. The radio attribute is optional. GPRS.cod files. The fileset element includes an optional directory element and one or more files elements. DataTAC.Development Guide Distributing BlackBerry device applications with the BlackBerry Desktop Software Element Attributes Description <files> c. in a single directory.

Only corporate system administrators should use the hidden tag. 0x0007 (German). nest these elements in the language element.Development Guide Distributing BlackBerry device applications with the BlackBerry Desktop Software Element Attributes Description The platformVersion attribute specifies the version of the operating system software on a BlackBerry device that a BlackBerry device application requires. some Win32 langid codes are: 0x0009 (English). hidden — language langid library id 50 . To support multiple languages. description. This tag is not intended for use by third-party software vendors. The hidden element hides a package so that it does not appear to BlackBerry device users in the Application Loader. or set the requires tag to load this package if another BlackBerry device application exists. To hide a package. 0x000a (Spanish). version. and copyright elements for each language. and 0x000c (French).6 or later supports this element. For example. a library module does not appear in the application loader tool of the BlackBerry Desktop Manager. specify multiple language elements. To specify the name. It contains the elements for a single library module. The language element lets you override the text that appears in the Application Loader when the Application Loader runs in the language that the langid attribute specifies. If you do not nest a element. add the following line: <hidden>true</hidden>. You cannot nest modules. Use this element in conjunction with the required element to load the BlackBerry device application by default. By default. You can use the library element instead of the application element. the text appears in the default language. The blackBerryVersion attribute specifies the version of the BlackBerry Device Software that a BlackBerry device application requires. The BlackBerry Desktop Software version 3. The langid attribute specifies the Win32 langid code for the language to which this information applies. vendor.

a required library also loads onto the BlackBerry device. and the BlackBerry device user cannot change this selection.Development Guide Distributing BlackBerry device applications with the BlackBerry Desktop Software Element Attributes Description Typically. This tag should not be used by third-party software vendors. The version attribute specifies the version of the application loader tool of the BlackBerry Desktop Manager. BlackBerry Desktop Software version 3. The requires element is an optional element that specifies the id of a package on which this BlackBerry device application depends. all packages that the <requires> tag specifies also load onto the BlackBerry device. The loader element contains one or more application element. loader version name — required — requires id 51 . When a BlackBerry device application loads onto the BlackBerry device.6 or later supports this element. The application loader tool of the BlackBerry Desktop Manager selects the BlackBerry device application for installation.5 or later supports this element. so that when a particular BlackBerry device application loads onto the BlackBerry device. BlackBerry Desktop Software version 3. which appears in the application loader tool of the BlackBerry Desktop Manager. This element can appear more than once. The name element provides a descriptive name for the BlackBerry device application. if the BlackBerry device application depends on more than one BlackBerry device application . BlackBerry Desktop Software version 3.6 or later supports this element. use the library element as the target of a <requires> element. Add the following line: <required>true</ required>. Only corporate system administrators should use the required tag. The required element lets you force an application to load.

Distribute an application for testing The BlackBerry® Java® Development Environment includes a command line tool called the JavaLoader tool that is located in the BIN folder in the BlackBerry JDE folder. You do not require any descriptor files or web pages. the JavaLoader tool is not designed for use by BlackBerry device users. which appears in the application loader tool of the BlackBerry Desktop Manager. You can use the JavaLoader tool to quickly install and remove compiled application files on the BlackBerry device directly over the USB port. They can then install the application using an ActiveX® control. The BlackBerry Application Web Loader can provide BlackBerry device users with a simple way to install applications from their computers without running the BlackBerry® Desktop Manager. This version number is for information purposes only. 52 . the BlackBerry Application Web Loader prompts them to connect their devices to the USB port. The JavaLoader tool can be useful when you install and remove your application frequently during testing and development. Distribute an application from a web page You can use the BlackBerry® Application Web Loader to post your compiled application on a web site.Development Guide Application distribution through a computer connection Element vendor Attributes — version — Description The vendor element provides the name of the company that created the BlackBerry device application. Application distribution through a computer connection Distribute an application from a computer You can use the application loader tool in the BlackBerry® Desktop Manager to install applications on the BlackBerry device. Users can use Windows® Internet Explorer® on their computers to visit the web page and install the application on their BlackBerry devices. The version element provides the version number of the BlackBerry device application. however. which appears in the application loader tool of the BlackBerry Desktop Manager. When BlackBerry device users visit the web page. The application loader tool can provide users with a simple way to download applications from their computers to their BlackBerry devices.

On the Project menu. Install a BlackBerry device application on a specific device 1.alx file.cod </files> 5. In the BlackBerry® Integrated Development Environment. select a project. <fileset series="8700" Java="1.alx file located in the simulator directory of your BlackBerry® Java® Development Environment installation directory: 4.alx file for the BlackBerry® device application.alx file.0"> 53 . see the Platform.6.02.cod file for your BlackBerry device application.0"> For more information about the series attribute. Open a text editor.14.alx files.alx file with the .0\simulator. <files> My_application. See the Application Loader Online Help for more information about . 3.alx File. description.cod files to BlackBerry device users. Update the application..alx file for each BlackBerry device application. and other tags to reflect the purpose of the . <application id="Push only to 8700"> . Make sure the files tag contains a reference to the .Development Guide Distributing an application from a computer Distributing an application from a computer Create an application loader file You use an application loader file to distribute a BlackBerry® device application using the Application Loader tool of the BlackBerry® Desktop Manager 1. <description>This will push the COD only to 8700s</description> Code sample: Loading a BlackBerry device application on a specific BlackBerry device <loader version="1. In the . Create an . Program Files\Research In Motion\BlackBerry JDE 4. click Generate . 3. 2. make sure the series attribute in the fileset opening tag refers to the BlackBerry device you want to install the BlackBerry device application on.. Locate the .0"> <application id="Push only to 8700"> <name>Alien</name> <description>This will push the COD only to 8700s</description> <version>2006.1838</version> <vendor>RIM</vendor> <copyright>Copyright (c) 2001-2005</copyright> <fileset series="8700" Java="1. and then distribute the . 2.

.) indicates any version between 4.4..cod </files> </fileset> </application> </loader> Specifying supported versions of the BlackBerry Device Software BlackBerry® device applications that use APIs that are only available on particular versions of the BlackBerry® Device Software should specify the supported BlackBerry device versions using the _blackberryVersion attribute.0..)"> .. </application> Code sample: Providing alternative modules for different versions of the BlackBerry Device Software. [4.0 and infinity.. modules for BlackBerry device software versions 4. 54 .)"> .0)"> .0.0 and later </fileset> </application> Code sample: Preventing modules from loading on versions of the platform earlier than version 2.0 </fileset> <fileset _blackberryVersion="[4.0. Code sample: Preventing modules from loading on versions of the BlackBerry Device Software earlier than version 4.0.0.. The _platformVersion attribute can be used within the directory tag. BlackBerry device applications for use with a BlackBerry device running on a specific platform version should specify supported platform versions using the _platformVersion attribute.66.4. Missing upper ranges imply infinity. modules for BlackBerry device software versions earlier than 4.. Round brackets () indicate exclusive (open) range matching. <fileset _blackberryVersion="(.Development Guide Specifying supported versions of the BlackBerry Device Software <files> My_application. <application id="application_id" _blackberryVersion="[4. or the fileset tag. You can use the following rules to specify a version range for the BlackBerry Device Software or the platform version: • • • • Square brackets [] indicate inclusive (closed) range matching. Missing lower ranges imply 0. <application id="application_id>"> . the application tag.. For example.

For a list of characters that are not valid.0.)"> .66. If you do not specify a location. you cannot use characters such as the less than sign (<) or greater than sign (>). if you develop a game.66)"> .4..)"> . the Downloads folder).4. For example. modules for BlackBerry OS plaform versions 2. If your application has multiple entry points. <application id="application_id>"> .66 and later </fileset> </application> Specifying a location for your application on a BlackBerry device You can add your BlackBerry® device application to one of the application folders that is available with the theme on the device. or to the Home screen on the device.0 or later. see the documentation for the FilenameTextFilter class in the API reference for the BlackBerry® Java® Development Environment..0. The following application folders are available with the Precision theme on a device that is running BlackBerry Device Software 5. to a new application folder that you create.0. </application> Code sample: Providing alternative modules for different versions of the platform.0.. modules for BlackBerry OS plaform versions earlier than 2.4.2...4..4.0: • • • • • • • • Applications Downloads Games Instant Messaging Mail Media Music Setup If you create a new application folder.Development Guide Specifying a location for your application on a BlackBerry device <application id="application_id" _platformVersion="[2.. you can specify an application folder for each entry point. You can specify the location of applications that are installed on a BlackBerry device that is running BlackBerry® Device Software 5.66. For example. the BlackBerry device adds your application to the default application folder (for example.66 </fileset> <fileset _platformVersion="[2. the folder name must use valid characters. 55 . you can add your game to the Games folder on the BlackBerry device.0. <fileset _platformVersion="(..

0 MIDlet-Version: 1. for each entry point. Package your project. open and package your BlackBerry device application project. In Eclipse®. Save the . If a user changes the location of your application. 4.0 MIDlet-Jar-Size: 2912 MicroEdition-Configuration: CLDC-1.1 MIDlet-Jar-URL: MyGame. Content-Folder: Games 56 . Test and distribute your application using the new package files. type Content-Folder: <folder_name>.jad file.jad file Manifest-Version: 1. type Content-Folder-x: <folder_name>. In a text editor. In the Package Explorer view. 7. Example: Adding an application to the Games folder by changing the . 2.0 or later. 6.img/mygame. in the Package Explorer view. • To specify locations for multiple entry points. 1. Specify a location for your application on a BlackBerry device You can specify a location to add your application to on a BlackBerry device by adding the Content-Folder attribute to the .Development Guide Specifying a location for your application on a BlackBerry device A user can change the location of your application on the device.0 MIDlet-Vendor: Research In Motion Ltd. If you do not see the folder or . For example. For example. type Content-Folder-1: Games for the first entry point and ContentFolder-2: Applications for the second entry point.cod RIM-COD-SHA1: 82 2f 22 b6 e6 34 ef c3 2b 0e a4 96 22 08 c0 60 39 4d db aa MicroEdition-Profile: MIDP-2.jar RIM-COD-Module-Dependencies: net_rim_cldc RIM-MIDlet-Flags-1: 0 RIM-COD-Module-Name: MyGame MIDlet-Name: MyGame RIM-COD-Size: 1504 RIM-COD-Creation-Time: 1272372497 MIDlet-1: My Game. RIM-COD-URL: MyGame.jad file. If you specify an application folder and the folder cannot be created.x> folder.x> folder to the root folder of your application project. add a new line to the end of the .x.jad file in the <project_folder>/deliverables/Standard/<x. removes. the device adds your application to the location that was previously specified by the user.jad file from the <project_folder>/deliverables/Standard/ <x. In Eclipse.jad file for your application. your application is added to the default folder (for example. and subsequently reinstalls your application.0.x. 3. drag the . open the . verify that you packaged your project.png. 5. Before you begin: Verify that the BlackBerry® device is running BlackBerry® Device Software 5. the device always uses the new location. type Content-Folder: /.jad file and type one of the following: • To add your application to the Home screen on a device. • To add your application to an application folder. the Downloads folder). if a user installs.

Resource content This file maps resource keys to string values for specific locales file (specific locales) (language and country). optionally.rrc (root locale). it creates a resource interface with Resource appended to the . and then.rrc AppName_en_GB. 57 . Files required for localization File required for Description localization Resource header file This file defines descriptive keys for each localized string. depending on the locale of the BlackBerry device user. save CountryInfo.rrh AppName. When the BlackBerry® Integrated Development Environment builds a project. Resources are organized in a hierarchy based on inheritance. Files have the same name as the resource header file. if you create AppName. and CountryInfo_fr. in the folder that contains CountryInfo. which groups the resources for an application. MIDP applications do not support localization.rrc Initialization file Save resource content files in the folder where the . For example. You can use the BlackBerry Integrated Development Environment to compile each resource bundle into a separately compiled . an underscore (_) and country code. This file initializes the resource bundle mechanism.java this file only when you compile resources as a separate project. For example. You require init.Development Guide Localizing BlackBerry device applications Localizing BlackBerry device applications Multilanguage support 7 The BlackBerry® Integrated Development Environment includes a resource mechanism for creating string resources. The application can switch languages. The Localization API is part of the net.rrc AppName_en. Example AppName. without requiring new resource bundles.rrh.cod file. It has the same name as the resource header file.api.java. You can load the appropriate . A ResourceBundleFamily object contains a collection of ResourceBundles. CountryInfo_en.cod files onto BlackBerry devices with the other .rrh file name. a string from the next closest locale is used.cod files for the application.i18n package.java file is located. The BlackBerry Integrated Development Environment stores resources for a locale in a ResourceBundle object. the interface is named AppNameResource.rrc AppName_fr. followed by an underscore (_) and the language code.device.rim.rrc (French). Resource content This file maps resource keys to string values for the root (global) file (root locale) locale. If a string is not defined in a locale.rrc (English).

For each resource locale in the library. In each resource locale project. On the Build tab. in the Output file name field. Do not build. Create a project for each resource bundle (locale). If you support a large number of locales.rrc) files to the projects for the appropriate locales. if the root locale project is named com_company_app. and then click Properties. and com_company_app__fr. Copy the resource header (. including the root locale. 6.device. 14. For example. You only need to create an empty initialization class with an empty main(). Create one resource header file for each BlackBerry device application. 7.rrh) files to the project for each BlackBerry device application. Add the resource content (.resource. com_company_app__en_GB. 2. 11.*.rrh) files and set the project type to Library. Give the projects for each resource locale the same name as the project for the root locale.rrh file. 13. import net. 12. type a name for the compiled file. 10.rim. Right-click the project. an underscore (_) followed by the country code. 1. public class init { public static void main (String[] args) { } } 4. Select Dependency only.i18n. Create one resource content file for each supported locale. 8. package com.Development Guide Manage localization files for a suite of BlackBerry device applications Manage localization files for a suite of BlackBerry device applications If you create a suite of BlackBerry® device applications.rim. the projects for each locale would be named com_company_app__en. define a dependency between the projects. Copy the resource header files to each resource locale project.device. 9. 3. 5. without a file name extension. create a single library project for all resource header (.api. Create one resource content file for each BlackBerry device application. right-click each . followed by a double underscore (__). The BlackBerry® Integrated Development Environment provides a built-in initialization mechanism. organize resources into separate projects for each locale. the language code. Open the BlackBerry® Integrated Development Environment. 58 . and then click Properties.samples. and. Create an initialization file. optionally.

rim. By default. see the API reference for the BlackBerry® Java® Development Environment. BlackBerry device users type a password to authenticate their identity and to generate a corresponding security token.device.userauthenticator package. a user must generate a security token. You must create a user authentication module to use additional hardware such as a smart card or biometric device for authentication purposes. For more information about custom user authentication and the net. 59 .Development Guide Custom user authentication Custom user authentication 8 To log in to a BlackBerry device. BlackBerry® devices that run BlackBerry® Device Software 5.0 or later also support custom user authentication modules. The security framework on the BlackBerry device uses your user authentication module to interact with the hardware.api.

alx file A . BlackBerry MDS BlackBerry® Mobile Data System CDMA Code Division Multiple Access COM port communications port EDGE Enhanced Data Rates for Global Evolution EVDO Evolution Data Optimized GAN generic access network GERAN GSM-EDGE Radio Access Network GPRS General Packet Radio Service 60 .Development Guide Glossary Glossary 3GPP Third Generation Partnership Project AES Advanced Encryption Standard API application programming interface APN access point name ASCII American National Standards Institute 9 .cod files to a BlackBerry device.alx file is the application descriptor that provides information about a BlackBerry Java® Application and the location of the application's .

Development Guide Glossary GSM Global System for Mobile Communications® HTTP Hypertext Transfer Protocol HTTPS Hypertext Transfer Protocol over Secure Sockets Layer IPPP Internet Protocol Proxy Protocol JSR Java® Specification Request MIDP Mobile Information Device Profile PAP Push Access Protocol PIN personal identification number RAPC RIM Application Program Compiler service books Service books determine which services are available on BlackBerry devices or BlackBerry enabled devices. SSID service set identifier TCP Transmission Control Protocol TLS Transport Layer Security Triple DES Triple Data Encryption Standard UDP User Datagram Protocol 61 .

Development Guide Glossary UMTS Universal Mobile Telecommunications System UTRAN UMTS Terrestrial Radio Access Network WAP Wireless Application Protocol WLAN wireless local area network 62 .

com/docsfeedback. visit www.blackberry.Development Guide Provide feedback Provide feedback To provide feedback on this deliverable. 10 63 .

• • • • • • • • • BlackBerry Java Application Fundamentals Guide BlackBerry Java Application UI and Navigation Development Guide BlackBerry Java Application Integration Development Guide BlackBerry Java Application Multimedia Development Guide BlackBerry Java Application Accessibility Development Guide BlackBerry Java Application Transitioning to Touch Screen Development Technical Note BlackBerry Browser Development Guide BlackBerry Developer Zone at www.com/developers API reference for the BlackBerry® Java® Development Environment 11 64 .Development Guide Related resources Related resources For more information on developing applications for BlackBerry® devices.blackberry. see the following resources.

Added file system and path reference information.Development Guide Document revision history Document revision history Date 27 April 2010 6 April 2010 Description Changed the Specify a location for your application on a BlackBerry device topic. 65 . Added the following topics: • Custom user authentication Updated the following topics: • Network connections and transport types • File systems and paths 12 8 October 2009 20 August 2009 14 August 2009 Added the following code samples: • Code sample: Reading sections of a binary file Added the following topics: • Specifying a location for your application on a BlackBerry device • Specify a location for your application on a BlackBerry device Added topics and sample code showing how to use features of the Network API. Changed the System requirements topic.

All rights reserved. REPRESENTATIONS OR WARRANTIES OF DURABILITY. compatibility.11a. and is not responsible for. however. SERVICE. ENDORSEMENTS. Java is a trademark of Oracle America. or any other aspect of Third Party Products and Services. and Windows are trademarks of Microsoft Corporation. and related trademarks. legality. This documentation might contain references to third-party sources of information. and 802. Wi-Fi is a trademark of the Wi-Fi Alliance. GUARANTEES. accuracy. OR TITLE. Inc. or other inaccuracies. SOME JURISDICTIONS MAY NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES AND CONDITIONS. Eclipse is a trademark of Eclipse Foundation. any Third Party Products and Services including. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY BY STATE OR PROVINCE. This documentation including all documentation incorporated by reference herein such as documentation provided or made available at www. RIM does not control. guarantee. NON-INFRINGEMENT. REPRESENTATIONS. MERCHANTABILITY. Inc.Development Guide Legal notice Legal notice 13 ©2010 Research In Motion Limited. names. links. 802. ANY IMPLIED WARRANTIES OR CONDITIONS RELATING TO THE DOCUMENTATION TO THE EXTENT THEY CANNOT BE EXCLUDED AS SET OUT ABOVE. ActiveX. OR RELATED TO THE DOCUMENTATION OR ITS USE. or warranty of any kind by Research In Motion Limited and its affiliated companies ("RIM") and RIM assumes no responsibility for any typographical. EXPRESS OR IMPLIED. or other additions to this documentation to you in a timely manner or at all. copyright compliance. Inc. Bluetooth is a trademark of Bluetooth SIG. endorsement.11g are trademarks of the Institute of Electrical and Electronics Engineers. and logos are the property of Research In Motion Limited and are registered and/or used in the U. this documentation may describe some aspects of RIM technology in generalized terms. updates.11b. BUT CAN BE LIMITED. 802. representation. technical. trustworthiness. errors. SATISFACTORY QUALITY. RIM reserves the right to periodically change information that is contained in this documentation. ARE HEREBY EXCLUDED. GUARANTEES. enhancements. performance. 66 . OR ARISING FROM A STATUTE OR CUSTOM OR A COURSE OF DEALING OR USAGE OF TRADE. OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED HEREIN. EXCEPT TO THE EXTENT SPECIFICALLY PROHIBITED BY APPLICABLE LAW IN YOUR JURISDICTION. Research In Motion®. Internet Explorer. without limitation the content. Inc. RIM makes no commitment to provide any such changes. All other trademarks are the property of their respective owners. FITNESS FOR A PARTICULAR PURPOSE OR USE. decency. iDEN is a trademark of Motorola. HARDWARE. Microsoft. ARE HEREBY LIMITED TO NINETY (90) DAYS FROM THE DATE YOU FIRST ACQUIRED THE DOCUMENTATION OR THE ITEM THAT IS THE SUBJECT OF THE CLAIM. and countries around the world. In order to protect RIM proprietary and confidential information and/or trade secrets. OR WARRANTIES OF ANY KIND.S. or omissions in this documentation. ANY CONDITIONS. RIM®. INCLUDING WITHOUT LIMITATION. MERCHANTABLE QUALITY. TO THE EXTENT PERMITTED BY LAW. BlackBerry®. UMTS is a trademark of European Telecommunications Standard Institute. OR PERFORMANCE OR NON-PERFORMANCE OF ANY SOFTWARE. The inclusion of a reference to Third Party Products and Services in this documentation does not imply endorsement by RIM of the Third Party Products and Services or the third party in any way. ENDORSEMENTS. Global System for Mobile Communications is a trademark of the GSM MOU Association. products or services including components and content such as content protected by copyright and/or third-party web sites (collectively the "Third Party Products and Services").blackberry. hardware or software. ALL CONDITIONS.com/go/docs is provided or made accessible "AS IS" and "AS AVAILABLE" and without condition.

SPECIAL. OR AGGRAVATED DAMAGES. Prior to subscribing for. except to the extent expressly covered by a license or other agreement with RIM. WHETHER OR NOT SUCH DAMAGES WERE FORESEEN OR UNFORESEEN. LOSS OF BUSINESS INFORMATION. AUTHORIZED RIM DISTRIBUTORS (ALSO INCLUDING AIRTIME SERVICE PROVIDERS) AND THEIR RESPECTIVE DIRECTORS. AGENTS. IN NO EVENT SHALL RIM BE LIABLE FOR ANY TYPE OF DAMAGES RELATED TO THIS DOCUMENTATION OR ITS USE. STRICT LIABILITY OR ANY OTHER LEGAL THEORY AND SHALL SURVIVE A FUNDAMENTAL BREACH OR BREACHES OR THE FAILURE OF THE ESSENTIAL PURPOSE OF THIS AGREEMENT OR OF ANY REMEDY CONTAINED HEREIN. ASSIGNS. FACILITIES OR SERVICES. CONSEQUENTIAL. or using any Third Party Products and Services. representations. INCIDENTAL. OR OTHERWISE TO YOU INCLUDING ANY LIABILITY FOR NEGLIGENCE OR STRICT LIABILITY. DISTRIBUTOR. IN NO EVENT SHALL ANY DIRECTOR. FAILURE TO REALIZE ANY EXPECTED SAVINGS. in relation thereto. DUTY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION. DOWNTIME COSTS. Check with your service provider for availability. You should not install or use Third Party Products and Services until all necessary licenses have been acquired. OR ACTION BY YOU INCLUDING BUT NOT LIMITED TO BREACH OF CONTRACT. IN ADDITION TO THE LIMITATIONS AND EXCLUSIONS SET OUT ABOVE. AND EVEN IF RIM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. COST OF SUBSTITUTE GOODS. Installation or use of Third Party Products and Services with RIM's products and services may require one or more patent. HARDWARE. it is your responsibility to ensure that your airtime service provider has agreed to support all of their features. trademark. AND (B) TO RIM AND ITS AFFILIATED COMPANIES. If required you are responsible for acquiring them. PROBLEMS ASSOCIATED WITH ANY APPLICATIONS USED IN CONJUNCTION WITH RIM PRODUCTS OR SERVICES. OR OTHER SIMILAR PECUNIARY LOSSES. You are solely responsible for determining whether to use Third Party Products and Services and if any third party licenses are required to do so. installing. SUPPLIERS (INCLUDING AIRTIME SERVICE PROVIDERS). guarantees. INDEPENDENT CONTRACTOR OF RIM OR ANY AFFILIATES OF RIM HAVE ANY LIABILITY ARISING FROM OR RELATED TO THE DOCUMENTATION. THE LIMITATIONS. Any Third Party Products and Services that are provided with RIM's products and services are provided as a convenience to you and are provided "AS IS" with no express or implied conditions. OR PERFORMANCE OR NONPERFORMANCE OF ANY SOFTWARE. FAILURES TO TRANSMIT OR RECEIVE ANY DATA. LOSS OF THE USE OF RIM PRODUCTS OR SERVICES OR ANY PORTION THEREOF OR OF ANY AIRTIME SERVICES. NEGLIGENCE. INDIRECT. DEMAND. LOSS OF BUSINESS OPPORTUNITY. DAMAGES FOR LOSS OF PROFITS OR REVENUES. COSTS OF COVER. OR CORRUPTION OR LOSS OF DATA. 67 . RIM SHALL HAVE NO OTHER OBLIGATION. endorsements. BUSINESS INTERRUPTION. OR LIABILITY WHATSOEVER IN CONTRACT. EMPLOYEE. Your use of Third Party Products and Services shall be governed by and subject to you agreeing to the terms of separate licenses and other agreements applicable thereto with third parties. OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED HEREIN INCLUDING WITHOUT LIMITATION ANY OF THE FOLLOWING DAMAGES: DIRECT. AGENT. COST OF CAPITAL. TORT. SUPPLIER. or warranties of any kind by RIM and RIM assumes no liability whatsoever. EXCLUSIONS. or other licenses in order to avoid infringement or violation of third party rights. copyright. TORT. SERVICE. EXEMPLARY. service plans and features. PUNITIVE. Some airtime service providers might not offer Internet browsing functionality with a subscription to the BlackBerry® Internet Service. roaming arrangements. AND DISCLAIMERS HEREIN SHALL APPLY: (A) IRRESPECTIVE OF THE NATURE OF THE CAUSE OF ACTION. AND INDEPENDENT CONTRACTORS. EMPLOYEES. THEIR SUCCESSORS.Development Guide Legal notice TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION.

and/or BlackBerry® Device Software. Surrey TW20 9LF United Kingdom Published in Canada 68 . ON N2L 3W8 Canada Research In Motion UK Limited Centrum House 36 Station Road Egham.Development Guide Legal notice Certain features outlined in this documentation require a minimum version of BlackBerry® Enterprise Server. Research In Motion Limited 295 Phillip Street Waterloo. NOTHING IN THIS DOCUMENTATION IS INTENDED TO SUPERSEDE ANY EXPRESS WRITTEN AGREEMENTS OR WARRANTIES PROVIDED BY RIM FOR PORTIONS OF ANY RIM PRODUCT OR SERVICE OTHER THAN THIS DOCUMENTATION. The terms of use of any RIM product or service are set out in a separate license or other agreement with RIM applicable thereto. BlackBerry® Desktop Software.

Sign up to vote on this title
UsefulNot useful