MBC Computer Solutions Ltd.

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 18 May 2006

Pushing HTML content to a Blackberry

Posted on 13:25 by Unknown

This is a re-post of an updated article I wrote for The Code Project


  • Download source - 9 Kb

Blackberry showing pushed HTML content


Introduction


Blackberry's (developed by Research In Motion - RIM) have become a critical part of many corporate networks including IT, financial and government networks. Their always connected nature and rich content delivery services (through Blackberry Enterprise Server and Mobile Data Service) make them very inviting to developers to develop applications for. Out of the box, you can deliver HTML content to them with very little work. Their Java-based operating system allows for developers to create applications that deliver data in real time and can be interacted with using the devices intuitive user interface and full QWERTY keyboard.

I am going to concentrate on the most simplistic way to delivery content to the device using a HTML browser channel. My next article may include a custom application for the handheld.

In order to use this code you need


  1. A Blackberry Enterprise Server 4.0 or above
  2. A Blackberry handheld running the 4.0 operating system or above
  3. The IPPP service book installed (automatically installed through Enterprise Activation)
  4. IIS 5 or above to run the WebService I have created

How It Works


The Mobile Data Service is completely HTTP based. You establish an HTTP connection to your Blackberry Enterprise Server (default port is 8300) with some query parameters and POST containing your data. The handheld's browser listens on port 7874 for incoming pushes. Custom Blackberry HTTP headers specify information about the content and how to display it (including read and unread icons, title, etc). For simplicity sakes, I am going to let the handheld use its default icons.


Using the code


I decided to implement this as a WebService to allow for easy access from other internal applications. The code is pretty straight forward. There is one WebService method and one protected method that handles actually creating the HTTP request and firing it off to the MDS server. Configuration information about the MDS server is held in web.config and can be accessed using the built in ConfigurationSettings.AppSettings collection.


The WebService method has the following signature:

public virtual void PushToBrowser(string[] recipients,
string channelTitle,
string channelName,
string baseLocation,
string message)

To use, create a new application, add a web reference to it (I called mine BesUtils). The code below illustrates how you'd push a simple HTML document to a handheld

BesUtils.MdsPusher pusher = new BesUtils.MdsPusher();

string[] recip = {"steven@mbccs.com"};

try
{
pusher.PushToBrowser(recip, "Hello World", Guid.NewGuid().ToString(),
"", "<html><head></head><body>Hello World.</body></html>");
}
catch(Exception ex)
{
Console.Write(ex.ToString());
}

The image at the top of this article illustrates the icon and text that appears when a new message has been pushed to the handheld. You would click the icon to open the browser and it would take you directly to the document you pushed down.


Points of Interest


  • You need to keep channelName constant if you want the handheld to update the same channel, otherwise a new channel will be created each time you push to the handheld.
  • To remove channels, open your browser (on your handheld), and in the bookmarks section there is a new Node called "Browser Channels". You can remove the channels from here.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • How to change the temperature scale on a Honeywell T6575 Thermostat
    [The complete documentation can be found at http://customer.honeywell.ca/techlit/pdf/95c-00000s/95c-10897.pdf ]   This was bugging me fo...
  • C# – Converting IP’s to Numbers and Numbers to IP’s in 2 lines of code
    I don’t know why everywhere I searched had such complex implementation of this, but converting from a dotted IP to a number (integer) and ba...
  • Why does iTunes setup need to close Outlook?!
    Everytime I update iTunes I remember why I left it so long - the install process is quite annoying! Can someone please explain to me why it...
  • Mac OSX 10.5.2 Freezing Intermittently
    I've been having an issue with my MacBook (you know, that computer I hide under my desk most of the time) where intermittently, the UI w...
  • ScottGu’s Color Scheme for Visual Studio 2010
    ScottGu was nice enough to provide the world with his awesome Visual Studio 2008 color scheme.  I’ve been using this for many years now an...
  • Don’t forget about the defer attribute for non-essential external scripts
    I was recently reviewing a customers eCommerce site and I noticed that the “Please Wait” page that occurs after completing an order but befo...
  • Windows Search 4.0 Released .....and searching finally works!
    I've been dealing with Outlook 2007's search problems since installing it way back then.  Most frequently, I'd search a keyword;...
  • Recursively finding controls - where to start?
    I love hearing about bugs and problems in components I have authored.  Most people hate hearing about bugs (I assume because they like to th...
  • Dell PowerEdge & Broadcom Issues
    For some time now we've been experiencing a problem across the board with Dell PowerEdge 2900/2950 servers equipped with Broadcom Gigabi...
  • Popup Window Manager
    I was just reading a post by Rick Strahl about managing popup windows in the browser.  I actually authored a mini popup window manager a wh...

Blog Archive

  • ►  2012 (1)
    • ►  February (1)
  • ►  2010 (1)
    • ►  April (1)
  • ►  2009 (7)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  July (1)
    • ►  April (2)
    • ►  February (1)
  • ►  2008 (36)
    • ►  November (3)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (6)
    • ►  May (4)
    • ►  April (1)
    • ►  March (4)
    • ►  February (7)
    • ►  January (5)
  • ►  2007 (35)
    • ►  December (1)
    • ►  November (9)
    • ►  October (3)
    • ►  September (6)
    • ►  August (7)
    • ►  July (9)
  • ▼  2006 (3)
    • ▼  May (3)
      • Welcome
      • ASP.NET Outlook-like Time Field
      • Pushing HTML content to a Blackberry
Powered by Blogger.

About Me

Unknown
View my complete profile