Setting up the sample application in the BlackBerry Java Plug-in for Eclipse

Install the sample application

  1. In Eclipse®, on the File menu, click Import.
  2. In the Import dialog box, expand the BlackBerry folder.
  3. Click Import BlackBerry Samples.
  4. Click Next.
  5. Perform one of the following actions:
    • To specify a specific JRE™, select the Use a project specific JRE option.
    • To specify the default JRE in the workspace, select the Use default JRE option.
  6. In the BlackBerry Projects section, click Deselect All.
  7. Select the check box beside the HTTPPushDemo project.
  8. Click Finish.

Run the sample application

To make sure that the application delivers the push data to the correct application, you must complete Step 5. Before the BlackBerry MDS Simulator can successfully deliver push data with application acknowledgement, it must determine whether the BlackBerry Smartphone Simulator supports application-level reliability. This support is determined by using the BlackBerry Smartphone Simulator to retrieve a web page through the BlackBerry MDS Simulator.
Before you begin: To perform this task, you must set Eclipse® to start the BlackBerry MDS Connection Service when you start the BlackBerry Smartphone Simulator
  1. In C:\Program Files\Research In Motion\BlackBerry Email and MDS Services Simulators 4.1.5\MDS\config, open the file in a text editor.
  2. In the file, verify that the line push.application.reliable.ports=100 is not commented out. If it is commented out, remove the comments.
  3. On the taskbar, click Start > Applications > Research in Motion > BlackBerry Email and MDS Services Simulators > MDS to start the BlackBerry® MDS Simulator.
  4. In Eclipse®, in the Navigator pane, right-click the HTTPPushDemo folder.
  5. Click Run As > BlackBerry Simulator.
  6. If necessary, on the Home screen of the BlackBerry® Smartphone Simulator, click the Downloads folder.
  7. Click the HTTP Push Demo icon.
  8. In your Eclipse installation folder, navigate to the HTTP server folder. The default installation path is C:\Program Files\Eclipse\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.16\components\samples\com\rim\samples\server\httppushdemo.
  9. In the server folder, double-click run.bat to open the server-side sample application.
  10. In the sample application, in the top field, type a message.
  11. To set the protocol that the application should use when it sends data, select the rim or pap option.
  12. Click Send.
  13. In the BlackBerry Smartphone Simulator, click OK.
The message that the server-side application sends is rendered on the client-side application in the BlackBerry Smartphone Simulator.
Previous topic: System requirements

Was this information helpful? Send us your comments.