BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-12-2006, 04:16 AM   #1
chetan.sawant
Knows Where the Search Button Is
 
Join Date: Sep 2005
Location: Mumbai, India
Model: 8100
Carrier: Airtel
Posts: 31
Question Access HTML file which is a part of .cod?

Please Login to Remove!

Hi,

Im developing a native java application.

I want to access a html file (eg test.html ) which is included in my Project. After building successfully it goes in .cod file.

Generally we are accessing stroed files ( in .cod ) by using getResourceAsStream() API. But it is not working with .html file.
I want to pass .html file to Browser..

I just want to know that how can we pass stored html file to Browser?

I tried following code, but it wont work....
This code launches Browser but not rendring html file as it requires a URL.

BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage("/test.html");


Any help appreciated....
Offline  
Old 09-12-2006, 10:19 AM   #2
jcomeau_ictx
Knows Where the Search Button Is
 
jcomeau_ictx's Avatar
 
Join Date: Dec 2004
Location: Columbus, NM, USA
Model: emu
Posts: 20
Default

What I had to do was to split the app into "client/server" modules, using the HTTP Filter API as the "server" and the Browser API for the "client". See my sample code at Index of /src/java/com/jcomeau/blackberry. It's unmaintained and may not compile, but you'll get the idea if you can stomach my coding style. (Warning: it makes some people vomit profusely).
__________________
Have you googled yourself lately?
Offline  
Old 09-12-2006, 10:29 AM   #3
kevin.ross
Knows Where the Search Button Is
 
kevin.ross's Avatar
 
Join Date: May 2006
Location: Franklin, Tennessee
Model: 8300
Carrier: AT&T
Posts: 42
Default

You would think it would be there wouldn't you?

Unfortunately, it is not. We have a solution but our codebase is closed. I hope you can understand, we have a large investment in it so we can't give it out.

BUT

I will tell you how we did it. Grab the RIM sample with that exemplifies use of a browser field and go from there. We made all local urls start with the protocol local://, then where the content was retrieved, check to see if it has the local protocol. If it does, load from getResourceAsStream(), if it doesn't, let it go as it would normally (over the wire).

Essentially, you will end up with your own BrowserScreen.

I hope that helps you.

Kevin Ross | Metova
__________________
Kevin Ross | Metova | www.metova.com
Offline  
Old 03-06-2007, 05:38 AM   #4
renuka_anil
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Unhappy Access local Html file

Hi,

Can i get the detail information about this. Bcoz I tried the way u explained. But that doenot work.

So, Plz help me out.

ur help will be appriciable.

Last edited by renuka_anil; 03-06-2007 at 05:40 AM.. Reason: to add text
Offline  
Old 03-06-2007, 05:41 AM   #5
renuka_anil
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Default

Quote:
Originally Posted by renuka_anil
Hi,

Can i get the detail information about this. Bcoz I tried the way u explained. But that doenot work.

So, Plz help me out.

ur help will be appriciable.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


NEW Siemens memory card 6ES7954-8LE03-0AA0 FedEx DHL Fast delivery picture

NEW Siemens memory card 6ES7954-8LE03-0AA0 FedEx DHL Fast delivery

$279.00



NEW NO BOX GOULD MEMORY MODULE ASSY M909-000 picture

NEW NO BOX GOULD MEMORY MODULE ASSY M909-000

$2500.00



Marposs 6331090800  Operator Memory picture

Marposs 6331090800 Operator Memory

$419.98



B&R 0MC111.9 PLC memory card with 60 days warranty picture

B&R 0MC111.9 PLC memory card with 60 days warranty

$185.00



New Factory Sealed Allen Bradley 1756-L55M13 Processor Unit Memory Expansion picture

New Factory Sealed Allen Bradley 1756-L55M13 Processor Unit Memory Expansion

$389.31



New Siemens 6ES7953-8LL31-0AA0 SIMATIC S7, Micro Memory Card 6ES7 953-8LL31-0AA0 picture

New Siemens 6ES7953-8LL31-0AA0 SIMATIC S7, Micro Memory Card 6ES7 953-8LL31-0AA0

$146.17







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.