-1

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

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 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.

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 )


I have develop the code to add my own menu-item into the Browser. By clicking on that custom-menu-item, I am receiving the URL successfully. But this doesn't meet my requirement actually.

As I told earlier, I want to track the browser application pro-grammatically through a third party application. So Is there any way, whenever Browser app comes to foreground, we can get the menu-item instance of the Browser (native application). So that I can run the custom menu item pro-grammatically.

I have used the following code:

Screen screen = Ui.getUiEngine().getActiveScreen();
System.out.println("\n\n**** " + screen.getClass().getName());
Menu menu = screen.getMenu(1);
for (int i = 0, cnt = menu.getSize(); i < cnt; i++)
           System.out.println(" menu item : " + menu.getItem(i).toString());
System.out.println("\n\n");

I am successfully tracking the applications whichever comes to foreground through a background thread of my application, but even then My third party application's thread can't get the menu-instance of the foreground-native applications. It always return the instance of my application's screen...

output of the above code :

** mypackage.AppDemoScreen menu item : Show Keyboard menu item : Switch Application menu item : Full Menu

Mechanical snail
  • 29,755
  • 14
  • 88
  • 113
  • I edited the title since what you need to track is the browser application, and not a `BrowserField`, which is a component embedded in your own application. BTW, I don't think you can track the browser from a third party app for security reasons. – Mister Smith Jun 20 '12 at 08:38

1 Answers1

0

you can use ApplicationDescriptor , and here is an example to add a new menu item with with the ability to avoid duble the custem menu item , also the code to recept the data from the browser and send it to the class you want
http://pastebin.com/BTSBL8AN

Alamri
  • 2,112
  • 2
  • 16
  • 21
  • thanks for ur support @Alamri.. would u explore ur idea please...Once I add my own/custom menu item to the native Browser application...how can that menu item return the url, when user clicks on that menu-item. – Rajani Dhawan Jun 20 '12 at 09:21