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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Developer
Posts: 42
Registered: ‎04-01-2009
My Device: Not Specified

Re: Loading a local html file in the browser

Thanks!
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Loading a local html file in the browser

BBDeveloper, I've been trying to do the same thing and your sample code works great.  Thanks.

 

Is it possible to link from one local HTML file to another?  If in foo.html I have a link like <a href="bar.html">bar</a>, the browser interprets that as "data://text/bar.html" and gives this error when you click on it: "A problem occurred while trying to render the page."

 

Any thoughts? 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Loading a local html file in the browser

I tried, providing the Absolute path of other local html file from first local html file and it worked.

 

Example: 

<a href="cod:///[Module Name]/BBDeveloper.html">Next page To COD</a>
<a href="file:///store/home/user/BBDeveloper.html">Next page</a>

 

PS: Tried using JDE 4.6on 9000 Simulator.


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Loading a local html file in the browser

[ Edited ]

The cod://... link works perfectly.  Also, it eliminates the need to deal with InputStreams, DataBuffers, byte arrays, etc.  I can now just load a local page directly in a BrowserSession:

 

Browser.getDefaultSession().displayPage("cod://<module>/<file>");

 

Thank you very much, BBDeveloper.  This was a huge help. 

Message Edited by almeida on 04-16-2009 10:13 AM
New Contributor
Posts: 6
Registered: ‎04-28-2010
My Device: Storm 9500
My Carrier: AT&T

Re: Loading a local html file in the browser

Absolutely works fine !

I had a problem with OS 5.0 with previous code was giving out of memory error

This single line has solved the problem