1

I'm working on RIM HttpFilterRegistry part. Can anyone explain on how to embed (protocol & packageManager class) in a native app with an UI entry point.

Requirement:

  1. To Launch native 3rd party app when a url from BB browser is selected.

  2. Can the registration be done at app installation if permitted or by an alternate entry point

A bit confused on how to implement the HttpFilterRegistry class.

There's little help on BB docs though :(.

There's a similar thread on the forum How to launch an application from the browser in BlackBerry

Community
  • 1
  • 1
Sarkozy
  • 11
  • 2

1 Answers1

2

You don't implement the HttpFilterRegistry class yourself, you use the one that RIM provides. Just call HttpFilterRegistry.registerFilter() like any other API call. What you do have to implement yourself is a java package that includes a class named Protocol. You then pass the package name to registerFilter(), and the browser will then access your Protocol class when the registered domain is invoked.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Thanks Remy for the quick one,... I see 2 protocol classes in the demo provided. Just need ur help if m moving in correct direction Say if I register as HttpFilterRegistry.registerFilter("www.testPage.com", "com.asb.test.httpfilter.precanned", true); What exactly protocol class include apart from the PAGE_DATA i.e the html page(www.testpage.com) so the browser understands there is a need to invoke app – Sarkozy Nov 18 '11 at 08:58
  • You can only have one `Protocol` class in the package you specify. In the demo, it has two packages and registers two URLs. The `na.blackberry.com` URL invokes the `com.rim.samples.device.httpfilterdemo.precanned.Protocol` class, and the `www.rim.com` URL invokes the `com.rim.samples.device.httpfilterdemo.filter.Protocol` class. In your case, `www.testPage.com` would invoke the `com.asb.test.httpfilter.precanned.Protocol` class. – Remy Lebeau Nov 18 '11 at 19:00
  • 0 down vote accept Tried the above steps for getting the app active but in vain :( ... What more need to be configured in the protocol class so there is an auto invoke for my native app. I still can't get the concept clear for this.. Your help is much more needed... – Sarkozy Nov 21 '11 at 08:52
  • What exactly have you tried so far? Please update your question with your actual code. Does your `Protocol` class implement the `FilterBaseInterface` and `HttpConnection` interfaces? – Remy Lebeau Nov 21 '11 at 22:12