BlackBerry
Skip Top Navigation
Developers Partners
North America [change region] Products Solutions Purchasing Support
Developers


Communicating with Other Applications

Exercise

Write applications that use the runtime store to communicate with each other. In this example, use the runtime store to obtain an instance of an autonomous background thread and determine its status (paused or running).

Objectives

  • Discover how to send and receive messages between applications.
  • Discover how to use alternate entry points.

Setup

  1. Download the file
  2. In the IDE, open the runtimestore_example.jdw workspace
  3. Open the RuntimeStoreExample.java source file.
  4. Open the RuntimeStoreExampleThread.java source file.
  5. Open the RuntimeStoreExampleAutorun.java source file.

Tasks

  1. In RuntimeStoreExampleAutorun.java, add code to the main method to create and start a RuntimeStoreExampleThread instance.
  2. In RuntimeStoreExample.java, add code to the constructor to retrieve a RuntimeStoreExampleThread object from the runtime store.
  3. In RuntimeStoreExampleThread.java, update the createInstance to retrieve a RuntimeStoreExampleThread object from the runtime store.
    TIP: Use the ID constant to identify the object. If the object does not already exist in the runtime store, create an object and add it.
  4. Set project properties so that the runtimestore_example_autorun project starts automatically, and the runtimestore_example_library project is a library on which the other two projects depend.
  5. Build and run the application.

Check Your Work

Download the completed code

Review

In this exercise, you discovered the following things:

  • how to retrieve a RuntimeStore instance
  • how to add and retrieve objects from the runtime store
  • how to use the runtime store for inter-process communication


Additional Labs

Go to the first exercise in "Creating Web Content for the BlackBerry Browser", Optimizing content for the BlackBerry Browser

Back to the Developer Lab Main Menu

 
Other Resources
 
     
 Home | Products | Solutions | Purchasing | Support | Developers | Worldwide | News | About Us | Contact Us | Site Map
 Legal | Copyright © 2008 Research In Motion Limited, unless otherwise noted.