Posts Tagged ‘blackberry’

* Long Live PhoneGap for BlackBerry

Posted on July 30th, 2009 by Dave Johnson. Filed under phonegap.

There have been some new developments in the PhoneGap on BlackBerry breathing new life into the project! It all boils down to the fact that in RIM OS >= 4.6 there is a browser rendering option that you can set to make the browser render using the modern rendering engine rather than the archaic one from OS 4.2.

It look something like this:

  RenderingOptions.CORE_OPTIONS_GUID, 17000, true);

After much trial and error it was found that the BrowserContentManager did not support this rendering option (and RIM says it is completely unsupported / experimental anyhow) yet the Field returned from BrowserContent.getDisplayableContent() does support it!

Long story short it looks like PhoneGap on RIM OS >= 4.6 is going to work really well.

Next up is looking at the new features in OS 5.0.

Tags: , , , .

* PhoneGap Project

Posted on March 24th, 2009 by Dave Johnson. Filed under phonegap, programming.

So I started putting together some wireframes for my first real PhoneGap project tonight. I have become sort of bored playing with BlackBerry and Android native development and figured it was about time to actually build something on top of the platform. The only problem I am having is that I can’t currently do offline apps on BlackBerry so am really looking forward to the next version of the RIM OS as I hear they may have fixed some of my gripes.

In the mean time I have been working on the PhoneGap simulator and Eclipse plugin as well that should be ready very soon - I actually have the simulator launching from my Eclipse PhoneGap project which is pretty cool.

Tags: , , .

* BlackBerry PhoneGap RIP

Posted on January 25th, 2009 by Dave Johnson. Filed under mobile, phonegap.

I was probably the only one working on PhoneGap for BlackBerry and now there might not be anyone. I have officially given up my BlackBerry programming endeavours for the time being in favour of greener pastures in the form of a Google Android G1. The final straw was when I found that the BrowserContentManager, which is the class one can use in their own BlackBerry application to render HTML content, does not support the same APIs as the actual web browser on the phone! In version 4.6 of the BlackBerry OS they introduced a proper, and fairly decent, web browser (that is definitely *not* WebKit as so many people like to say) and yet the BrowserContentManager is stuck back in the OS 4.2 days. Not sure if the Storm (OS 4.7) has changed that or not, although the API of the normal browser in 4.7 is identical to 4.6 so I assume not and somone on the BlackBerry support forums corroborates my findings.

I am working on my first Android application today and will hopefully get some PhoneGap work in there too.

Tags: , , , , .

* BlackBerry Browser Oddities

Posted on January 4th, 2009 by Dave Johnson. Filed under phonegap.

So for PhoneGap on BlackBerry I was using a BrowserContentManager to achieve the PhoneGap functionality. I finally got around to installing the BlackBerry Bold 9000 simulator (OS 4.6) with hopes that the BrowserContentManager would support nice things like Node.innerHTML and other things that one might like for making web apps.

Alas, I was terribly wrong. Here is what the BrowserContentManager content looks like:

And the native BlackBerry browser looks like this:

The main things to notice are:

  • the font in the native browser is way nicer (anti-aliasing goes a long way I guess)
  • the buttons are different
  • there is no CSS being applied in the BrowserContentManager
  • the BrowserContentManager does not appear to support the mouse pointer mode

Of course not visible is the very different JavaScript DOM API…

I am still investigating but so far I am not very impressed by the functionality of the BrowserContentManager. Is there a better way to achieve the PhoneGap functionality?

Tags: , , , .

* BlackBerry PhoneGap Progress Report

Posted on December 6th, 2008 by Dave Johnson. Filed under phonegap.

BlackBerry PhoneGap
We had a PhoneGap sprint just over a week ago which was pretty successful for me and my BlackBerry ambitions as well as everyone else. Through that sprint and over the past week, despite some setbacks, I got the OS v4.5 installed on my phone and the simulator on my computer giving me access to a few new things but I was sad to find that a few other things were still sorely lacking that are pretty important for something like PhoneGap. Just so you know, OS v4.5 is the latest OS that will run on my Curve 8310 - 4.6 will run on the Bold, Pearl Flip and newer Curves while 4.7 works on the Storm. The two biggest gaffs by RIM are in the BlackBerry web browser for OS v4.5 where that the following rather important features are missing:

  1. You can’t pass function pointers to setTimeout.
  2. You can’t access DOM Nodes in any way shape or form (aside from form fields). So there is no getElementById or innerHTML on the resulting nodes. This make web application development a little bit difficult.
  3. There is no XMLHttpRequest object.
  4. While not really expected, there is no SQLite support
    anywhere on the phone as of yet, let alone the browser.

Anyhow, despite those setbacks on the v4.5 OS I did get the communication between the BlackBerry device and the web page all dialed now. Not only that but I have implemented the W3C geolocation API and am going to follow that same pattern for the other APIs. Check out the geolocation JavaScript interface as well as the platform specific implementation.

In the actual BlackBerry code there is lots of boiler plate stuff. The main hurdle was figuring what the best (or any) way to embed the browser in the application was and enable communication between JavaScript in the browser and the BlackBerry Java code. In the end I pretty much had to take the route of implementing the browser myself through the BrowserContentManager. This means that I have to implement lots of functionality, but it also means that I am in control of cookies and responsible for accepting them from JavaScript in the web page through the implementation of the browser fields RenderingApplication.eventOccurred method when the event type is EVENT_SET_HTTP_COOKIE and returning them to JavaScript by implementing the RenderingApplication.GetHTTPCookie method.

When the set cookie event occurs I parse out the cookies looking for one named bb_command and expect it to contain some JSON object (that is parsed with the J2ME port of a Java JSON lib) with a command property (like for opening maps or getting the GPS location) and some arguments (like points to plot on the map or how long to vibrate for). The case statement just looks like this:

switch (command)
  case 0:
    this._getLocation = true;
  case 1:
      new MapsArguments(MapsArguments.ARG_LOCATION_DOCUMENT,
  case 2:
      new CameraArguments()
  case 3:
    if (Alert.isVibrateSupported())
  case 4:
      new PhoneArguments(PhoneArguments.ARG_CALL,

where args is just a JSON string that the various methods like getPhoneNumber parse to get the args they want.

I will post some more specific code snippets like how to send text messages and so on very soon.

Tags: , , , , , , , , .

* Blackberry Storm Simulator/API Available

Posted on November 13th, 2008 by Dave Johnson. Filed under mobile, phonegap.

For those interested in Blackberry development the simulator is now Available from RIM.

In the summary of changes to the API there were a few things of note including new classes for the touch screen, virtual keyboard, orientation and rotation, and accelerometer. Oh and how could I forget that Storm owners will also have the ability to set the theme wallpaper!

The JavaDocs for the 4.7 API (the OS version of the Storm) can be found here for reference.

The one good thing is that it should not mean I will need to make any changes to the Blackberry version of PhoneGap! However, unluckily it means that Storm is still using the same shitty old browser and not WebKit.

Tags: , , , , , .