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
Contributor
Posts: 19
Registered: ‎09-10-2012
My Device: BlackBerry Curve 8520
My Carrier: BlackBerry

local html file is not being opened in OS 6 & 7

[ Edited ]

Hello Everyone,

 

I need to show local html file which is included in my project.

By using,

            BrowserSession session = Browser.getDefaultSession();
            session.displayPage("cod://MyProjectCodeFileName/HTMLFileName.html");

I am able to open local html file in OS 5.0, but its not working in BB OS 6.0 and 7.0.

 

In OS 6.0 and 7.0 address bar of native browser, automatically http:// is added before "cod://MyProjectCodeFileName/HTMLFileName.html" and cod// is there instead of cod:// and final url is like this-

http://cod//MyProjectCodeFileName/HTMLFileName.html .

A prompt is being shown that "Unable to find the requested server". Is it the OS issue or something else?

 I tried in Os 5.0 browser and in this "cod://MyProjectCodeFileName/HTMLFileName.html" is opened.

Can anyone please look into this and help.

 

Thank in advance.

 

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

Re: local html file is not being opened in OS 6 & 7

use local:///test.html as the url to be loaded in the browserfield... Assuming test.html resides in the res folder of the project!!