04-26-2010 03:47 PM
I display a local web page in the browser. When the user clicks certain links, I need my Java code to get notified somehow such that I can take certain actions. This seem possible in 5.0 using BrowserField. However, we really need to support pre-5.0 if possible. Can anyone suggest a way to accomplish this?
We have full control over the HTML content so we can set the hrefs of the links to use some unusual protocol or string if need be.
04-29-2010 03:22 PM
You could implement an HttpFilter to accomplish this. The HttpFilter allows you to register a specific domain. Then, whenever the BlackBerry Smartphone attempts to access that domain the connection would be passed to your application, which could supply the content (could be local or remote).
So you could make use of a unique domain for these links within your local content that get routed through the HttpFilter. The httpfilterdemo included with the BlackBerry Java SDK and BlackBerry JDE shows an example of this.