|
 |
 |
Exercise
Build an HTTP PUSH server using either Java or .NET; this server will have the capability to push to the BlackBerry® Browser.
Objectives
- To gain experience using BlackBerry MDS and push.
- Discover how to use a simple HTTP connection to initiate a PUSH
- Review the three Browser PUSH types:
- Channel Push
- Cache Push
- Message Push
Setup
Java version:
- Download the file
- Open the directory: “Workspaces\Incomplete\BlackBerry Web Content\Browser Push\Java”
- Open the HttpPushWorker.java source file
- Open the PushUI.java source file
NET version:
- Download the file
- In Visual Studio .net, open the project found in the directory: “Workspaces\Incomplete\BlackBerry Web Content\Browser Push\dotNet”
- Open the HttpWorker.cs file
Tasks
- Select either the Java or .NET version of the server to work with.
- Complete the httpPush Method
- Create an HTTP connection to read from the source webpage
- Once the source is read, create an HTTP connection to do the PUSH
- Add the necessary PUSH headers, as well as any important headers from the source page (such as Content-Type)
- Write the data from the source page to the output part of the Push connection.
- Read the response from the server
- Close any open Connections, Streams or Readers
Check Your Work
Download the completed code (Java)
Download the completed code (dotNet)
Review
In this exercise, you discovered the following things:
- gained experience using BlackBerry MDS and push.
- to initiate a PUSH through a simple HTTP connection.
- the three Browser PUSH types: Channel Push, Cache Push, Message Push
Additional Labs
Go to the first exercise in “Security for BlackBerry Applications”, Basic encryption and decryption
Back to the Developer Lab Main Menu
|
|
|
|