Pushing HTML Content to a BlackBerry

Introduction

BlackBerries, 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. Out of the box, you can deliver HTML content to them with very little work. Their Java-based operating system allows developers to create applications that deliver data in real time and can be interacted with using the device's intuitive user interface and full QWERTY keyboard.

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

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, and so forth). For simplicity's sake, I will let the handheld use its default icons.

Using the Code

I decided to implement this as a Web Service to allow easy access from other internal applications. The code is pretty straightforward. There is one Web Service 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 Web Service method has the following signature:

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

To use it, create a new application and 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.



About the Author

Steven Berkovitz

Steven is VP Development at MBC Computer Solutions Ltd. (http://www.mbccs.com), a Markham based company specializing in e-Business Application Development, e-Store Solutions, Managed Co-Location and Proactive IT services. Steven has over 10 years experience in software and hardware design and is experienced with a large array of platforms, technologies and languages. Steven also has 3 years experience in QA software development for the accounting industry.

Downloads

Comments

  • If one loses one’s own feelings,he or she appear to adequate Beats by Dr. Dre earbuds

    Posted by motherdhmm on 06/04/2013 11:50am

    [url=http://www.headphonescheaponlineaustralia.com/]dr dre beats[/url] I improvise Mutation Beats At hand Dr. Dre Solo HD headphones it can Increase transparency and exceptional vigorous, procreate music refined durable excellence when people listen to music. It can fix up with provision a good and complacent coated sensitivity, effective excise off the independent sound, but won¡¯t beget brutal sensitive ready to drop with a view people. It benevolent as far as something environmental shelter efforts promote and all products can work biodegradable materials manufacturing. It worn exposed design, makes the voice return faster, lively, more befitting since stupefy, report, exemplary and jazz music. [url=http://www.headphonescheaponlineaustralia.com/]dr dre beats[/url] Has a new dr dre beats, you can fancy unconstrained music to carry you the fun. The Monster has been expanding their consequence present lately with unheard of audio products like earbuds and headphones, and I accept to say that, notwithstanding that I was a doubting thomas, I sweetheart my Living abortion Turbine headphones-they¡¯re the most appropriate sounding earbuds I¡¯ve ever heard . Spacious earcups impart you ancillary compartment looking for a higher plain of listening comfort.Plush appreciation cushions covered with ultra-soft breathable materials block you relaxed settle when the music¡¯s hot. in the songs you bring out to the function of strict comfort. [url=http://blog.cheapbeatsbydre.co.nz/monster-headphone]monster beats headphone[/url] Mutant¡¯s after 20 years of carrying out establishment in decline. Right away there are two hundred four thousand kinds of products and epidemic self-evident several. The occultism impression of the company¡¯s products won numerous electrical toil, the Lay out Modernization Endow with and the calibre award. Various acclaimed singers in the Synergistic States use polished wire of the allurement be activated of their instruments, including myriad of the musicians made ??the Grammy Award (the Grammy Awards). The famed recording artists, engineers and recording studios speak Nightmarishness cables to record their music.

    Reply
  • Short piece of writing discloses the indisputable details on gucci and precisely how it can have a bearing on anybody.

    Posted by incockDak on 04/25/2013 11:11pm

    All new queries about nike addressed and as a consequence the reason why you should definitely scan through each and every message on this article. [url=http://www.mizunogoruhujp.com/]mizuno[/url] Precisely why every thing you learned about nike is completely wrong and what you want to learn.[url=http://www.mizunogoruhujp.com/ミズノ-ゴルフクラブ-c-1.html]ミズノ アイアン[/url] Different queries about nike clarified in addition to the reasons why you has got to analyze each and every phrase in this expose. [url=http://www.mizunogoruhujp.com/ゴルフグローブ-c-33.html]グローブ ミズノ[/url] Find who is posting about nike and reasons why you should get worried. [url=http://www.mizunogoruhujp.com/ゴルフバッグ-c-7.html]ミズノ[/url] Supplies and production in New york : nike has left without any hasta la vista [url=http://www.mizunogoruhu.com/]ミズノ グローブ[/url] The Primary Procedures To Develop nike Plus The Way One Can Become a member of The nike Top dogs [url=http://www.mizunogoruhu.com/ミズノmizuno-クラブ-c-4.html]ミズノ グラブ[/url] What scientists normally are not discussing over nike and also how it has an effect on you actually. [url=http://www.mizunogoruhu.com/ミズノmizuno-アイアン-c-3.html]ミズノ[/url] Basic fundamentals of the mizuno which you could profit by starting today. [url=http://www.mizunogoruhu.com/ミズノmizuno-アイアン-c-3.html]ミズノ アイアン[/url] The Secret master the mizuno-world Is Fairly Straight forward! [url=http://www.mizunogoruhu.com/ミズノmizuno-バッグ-c-5.html]ミズノ[/url] Whatever the scientists might not be claiming in regards to nike and ways this is relevant to you actually.

    Reply
  • Strange editorial delivers the main points around nike which experts claim just one or two customers are conscious of.

    Posted by icoppyapedcap on 04/25/2013 12:13pm

    ZgyHyyWqkZrn [url=http://www.nikeyasuijp.com/]nike[/url]OqlCiqGumUdr [url=http://www.nikeyasuijp.com/nike-air-force1エアフォース1-c-14.html]ナイキ フリ[/url]NngTzaVatUal [url=http://www.nikeyasuijp.com/nike-air-maxエアマックス-c-12.html]nike air max[/url]LdhDxbCjoDnt [url=http://www.nikeyasuijp.com/nike-air-jordanエア-ジョーダン-c-13.html]nike free[/url]HezCgfUndYqx

    Reply
  • Icon removal

    Posted by gardavis on 02/21/2006 04:56pm

    After figuring out my company's server domain, the default ports worked and I received the HTML. What about that icon? How do I remove it? Thanks for the useful app. Gary

    • Removal

      Posted by sberkovitz on 02/21/2006 05:02pm

      Go to your browser bookmarks, there is a new folder named "Browser Channels". you can delete it from here.

      Reply
    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Relying on outside companies to manage your network and server environments for your business and applications to meet the needs and demands of your users can be stressful. This is especially true as many Managed Hosting organizations fail to meet their service level agreements. Read this Forrester total economic impact report and learn what makes INetU different and how they exceed their customers' managed hosting expectations.

Most Popular Programming Stories

More for Developers

RSS Feeds