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: 70
Registered: ‎09-17-2008
My Device: BlackBerry Bold 9000
My Carrier: Rogers

Invoke Browser with media file

Hello,

 

I have a question about invoking the blackberry browser through my application. I am trying to invoke the browser to save an MP3 file hosted on a webserver.

 

The piece of code I'm currently using is:

 

String theUrl = "http://xxx.xx.xxx.x:80/file.mp3"; Browser.getDefaultSession().displayPage(theUrl);

With the code above, the browser successful launches, but just sort of hangs and eventually fails. 

 

Now, if I opened up a separate instance of the BlackBerry browser and enter the URL "http://xxx.xx.xxx.x:80/file.mp3" (same as above) - I get the option to Open/Save/Cancel the mp3 file.

 

How would I go about invoking the browser to give me the same options? It seems that invoking the browser using the code above, skips the portion where the browser evaluates what to do with the URL (either save a file or load a webpage). If the above isn't possible - is there a way to do it by invoking the media player directly with a URL? 

 

Would appreciate any insight. Smiley Happy Thanks!

 

 

Highlighted
Developer
Posts: 70
Registered: ‎09-17-2008
My Device: BlackBerry Bold 9000
My Carrier: Rogers

Re: Invoke Browser with media file

Nevermind. Smiley Happy

 

It seems  had my simulator set as Browser as default instead of Hotspot Browser (which is the working internet connection). Switching default to Hotspot and it all works not. Hurrah!