Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 55
Registered: ‎05-30-2011
My Device: BlackBerry torch 9800
My Carrier: Airtel

how to get url from browser?

[ Edited ]

Hi friends,

 

In BB when user typed any URL into the browser and hit enter....  then is it possible to get/track/fetch that url..??? 

 

My application need is  -

1) get the url, whatever user have typed in the browser field of the browser...

2) send that url to the server, in the form of xml

3) check response from the server......

4) if response value is "yes" then do nothing...

5) but  if response value is "no"  then block that URL  ( regiseter that - URL into HttpFilterRegistery )

 

please help,

 

Thanks.

 

 

Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: how to get url from browser-field ?

[ Edited ]

browserfield.getDocumentUrl() will  accomplish ur task ... And as far as blocking is concern I don't think there is any method in the api to do it..  Still you can use goBack method...

Developer
Posts: 55
Registered: ‎05-30-2011
My Device: BlackBerry torch 9800
My Carrier: Airtel

Re: how to get url from browser-field ?

thanks to give support kiran, Smiley Happy

 

would u pls explore ur idea...little more...

 

shuld i implement any ineterface in my application.......that can track, when user opens the browser and passes a url.

 

I just want to tell u that my application will run in the background......and from background I want to get the URL from BB's native browser.  Means when user open the browser and pass a url,  I have to get that url and check whether my Application should block that or not.

 

Please provide some help on this... 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to get url from browser-field ?

[ Edited ]

There is no standard way to track the Browser's activity from an external program.  That would be against the BB security model I suspect.

 

Have a search around and you will see that other people have asked similar questions.  You might find these two useful:

 

http://supportforums.blackberry.com/t5/Java-Development/Capture-URL-from-Browser-Address-bar/m-p/144...

 

http://supportforums.blackberry.com/t5/Java-Development/getting-URL-from-Browser/m-p/676625

Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: how to get url from browser-field ?

Ur  Subject suggests that u r trying to retrieve the url frm browser- field... But ur reply intends to draw the url from native browser... What do u actually want to do??

Developer
Posts: 55
Registered: ‎05-30-2011
My Device: BlackBerry torch 9800
My Carrier: Airtel

Re: how to get url from browser-field ?

@kiran, sorry if i hv used wrong words in subject.  yes I want to get url......like, when user enters a URL (www.google.com) on the Address Bar and hits "Go" or presses "Enter" key, I have to get/receive that url from my application (background application)....

 

 

 

Developer
Posts: 55
Registered: ‎05-30-2011
My Device: BlackBerry torch 9800
My Carrier: Airtel

Re: how to get url from browser-field ?

thanks @peter,  but as suggested in the second link :

 

http://supportforums.blackberry.com/t5/Java-Development/getting-URL-from-Browser/m-p/676965#M136115h...

 

that we can add our custom menu-item in the native browser application.. but I cant do this because of security policy of our applicatio. So I dont want to add own menu-item into browser application.

 

please give soem other suggestion if u hv........ I have searched throughly the browser related api's but unsuccessfull till yet.

 

 

 

Developer
Posts: 55
Registered: ‎05-30-2011
My Device: BlackBerry torch 9800
My Carrier: Airtel

Re: how to get url from browser-field ?

hey kiran, I have edited my subject / title since I need to track the browser application, and not the Browser-Field.

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to get url from browser?

Please re-read my post and search the forum.  You will find that this question has been asked before and no-one has given any method of doing what you want.  And as I noted, it would be against the BlackBerry security model.  So I suggest you go back to whoever asked you to do this and say it can't be done.  OK?

Developer
Posts: 55
Registered: ‎05-30-2011
My Device: BlackBerry torch 9800
My Carrier: Airtel

Re: how to get url from browser?

anyways Peter, First I will try at my best........and do searching on this task........for some days....

 

Then I will tell you.

 

Meanwhile If you or Kiran will find any trick then please tell me... I'll be greatful to u.

 

thnks.