0

I have designed a blackberry application and it is working fine. But i need my application to open in two ways. One is when my application is clicked it should open and this is working fine. Second way of opening is whenever a link is clicked in a mail, my application should open.I have a little idea that we have to register the link in our application through Httpregistry. If this is true please help me how can it be done else please provide me a solution to acheive that functionality.

G B
  • 2,951
  • 2
  • 28
  • 50
iOS dev
  • 470
  • 7
  • 23
  • Possible duplicate of: http://stackoverflow.com/questions/4568503/how-to-launch-an-application-from-the-browser-in-blackberry – G B Nov 15 '12 at 09:40
  • Excuse me, it is not about launching from blackberry browser. I have to launch my application whenever i get an email which consists of a link. Please explain me how Httpregistry works – iOS dev Nov 15 '12 at 11:08

1 Answers1

3

You have 3 different options:

I'd try with an HTTP Filter first, the StringPattern has a lot of side effects.

You also have to start your application at least once to register the String pattern or HTTP Filter. It can be done by defining an alternate entry point which is called on system startup.

G B
  • 2,951
  • 2
  • 28
  • 50
  • Thanks for the reply,could you please show me some sort of coding for how to register my application through 1stmethod – iOS dev Nov 15 '12 at 12:42
  • As in http://stackoverflow.com/questions/4568503/how-to-launch-an-application-from-the-browser-in-blackberry - You can check the "HTTPFilterDemo" sample. You can find that code also online under https://github.com/blackberry/JDE-Samples/tree/master/com/rim/samples/device/httpfilterdemo – G B Nov 15 '12 at 13:09
  • Hi, Httpdemo is fine but where to put that piece of code in my application so that when i click the link at someother place in my phone then my application should open. please help me in this thing. – iOS dev Nov 16 '12 at 06:11
  • You should call HttpFilterRegistry.registerFilter when your application starts, then your filter is registered. A filter is a Java package containing a Protocol class, which implements FilterBaseInterface. Use the code in HttpFilterDemo to get started, changing only the parts you need to customize. – G B Nov 16 '12 at 07:07
  • you are telling me to call the HttpFilterRegister.registerfilter when my application starts, but what is the point of starting? as of my knowledge main() method i.e eventdispatcher is the point where application is starting..but how can i call at that point?. Moreover whenevr link is cliked, again my application has to start, means should i call event dispatcher again? please help me with some code..im unable to understand... – iOS dev Nov 16 '12 at 09:25
  • You can define an alternate entry point for your application, and start it on system startup in order to register the new filter (then exit). Your application gets different parameters on the command line for different entry points, you can check it and then run the application (normal start) or only register the filter and then exit (initialization). – G B Nov 16 '12 at 09:37
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/19629/discussion-between-user1735165-and-g-b) – iOS dev Nov 16 '12 at 09:40