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
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

How to handle browser events

From my App i am downloading some file,which i am giving to browser session object to download.It downloads fine.Now i want to know whether is it possible to capture,if download has been successful,i mean when it shows the OK button in th browser,i can perform some task from my main screen class.

Regular Contributor
amr3434
Posts: 81
Registered: ‎01-16-2012
My Device: BOLD 9650 + developer

Re: How to handle browser events

can u explain  more !!!!

Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

Re: How to handle browser events

Surely,actually from my app i am dowloading certain third party app.So i give the download link,which points to a jad file to the browser.It downloads fine and shows an OK message.What i want now is that when i click the OK in browser,i should be able to perform some specific task

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

Re: How to handle browser events

I presume you are sending this request to the Browser, which is running the download independently of your application?

 

If so, I am not aware of any way you can interact with the Browser and have it tell you when the download is complete.  Nor am I aware of a way of listening for applications added to the device.  So I think in this circumstance the only option is to look for the application so you can check to see if it is there in some way.  If it is your application then you should be able to perform some interaction.

 

Alternatively you could download it yourself?

Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

Re: How to handle browser events

how to download it myself,without the browser?

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

Re: How to handle browser events

[ Edited ]

Look at this KB article:

http://supportforums.blackberry.com/t5/Java-Development/Programmatically-install-and-upgrade-applica...

 

Search the forum too - there have been other questions about downloading applications. 

Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

Re: How to handle browser events

Btw i have now tried with browserfield,its downloading fine in simulator,but in the real device it throws content type error,i am setting the content type like this

 

BrowserFieldConfig _bfConfig = new BrowserFieldConfig();
	
		_bfConfig.setProperty("Content-Type", "text/vnd.sun.j2me.app-descriptor");
		_bfConfig.setProperty("Content-Type", "application/vnd.rim.cod");
		BrowserField browser = new BrowserField(_bfConfig);
		
		add(browser);

		browser.requestContent(Url);

 Is it the correct way to set the content type for downloading jad file in browserfield

Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

Re: How to handle browser events

Any idea?