API control and code signing
When you develop a BlackBerry® Java Application for BlackBerry devices, you can use only the public Java APIs that are published
and documented in the Javadoc™ documents in the BlackBerry® Java® Development Environment. The BlackBerry® Java® Virtual
Machine on the BlackBerry device is designed to protect the underlying data and operating system, so applications cannot call
undocumented or unsupported APIs or access data that is not explicitly exposed through the APIs. If you try to use Java APIs
that are not publicly exposed, your application receives an error message at runtime.
Public APIs are either open or signed. Signed APIs expose the methods to access BlackBerry device user data or other information
on the BlackBerry device that is considered sensitive. You can use signed APIs, but you must request and receive a set of code
signing keys from Research In Motion. You must then digitally sign your application before you install it on a BlackBerry device.
Code signing does not certify or approve an application; it allowsRIM to identify the author of an application that uses sensitive
APIs, if the application is malicious.
To request a set of code signing keys, visit
www.blackberry.com/developers/downloads/jde/api.shtml
. You will receive your set
of code signing keys in about 10 days.
Object modeling
Whether you use the MIDlet or the CLDC application model, you must use an object-oriented approach when you design your
application for the BlackBerry® device. In an object-oriented approach, developers use objects to contain the code that is common
to a specific process or function. For example, a developer might use separate objects to control networking activity, data storage,
data processing and manipulation, and user interface interaction. When you design your application, start with a good object
model.
Multithreading
The BlackBerry® operating system is a multithreaded operating system, which means that many applications and processes can
run actively on the BlackBerry device at the same time. For example, applications can use background threads to manage
processor-intensive tasks or network communications so that they do not affect the main thread. If an application creates
background threads, and a BlackBerry device user closes the application, the background threads can remain active.
Best practice: Using multithreading
Make effective use of the multithreading capabilities of the BlackBerry® operating system. In particular, always create a new
thread for network connections or other lengthy operations (more than one-tenth of a second). Use background threads for
listeners or other processes that run in the background when the application starts.
Fundamentals Guide
API control and code signing
12