ClickAider

Extending the Blackberry Browser with Plugins and XML Scripting

The Blackberry API is powerful but also incompletely documented; I’ve had to uncover many parts of it by searching multiple sources and through trial and error.

The sample code in this post illustrates several features of the Blackberry API used in the Berry411 application. The BrowserContentProvider interface allows an application like Berry411 to register itself as a handler for a custom mime-type “text/xml-berry411″. Berry411 uses the SAX parser interface to parse and interpret scripting commands in the document returned from the server– in effect this allows Berry411 to define its own custom scripting language allowing web pages to interact with the address book and other features of the Blackberry.

The BrowserContentProvider also allows an application to define its own rendering for pages that take advantage of all of the Blackberry UI widgets, rather than relying upon the browser for rendering.

Finally, the sample code illustrates a “launchOrRaiseApp” method which will ensure that the application with the given module name (e.g. “berry411″) is running and in the foreground. If the application is already running, it will be foregrounded, otherwise it will be launched.

See the sample code

1 Comment so far
Leave a comment

[…] (From a technical standpoint, there is some very interesting magic going on behind the scenes to enable these features– a new XML based scripting language registered by Berry411 that allows a web page to interact with the address book and other features of the phone. I describe how this works in more detail in a subsequent post.) […]


Leave a comment

(required)

(required)