BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 09-12-2006, 04:16 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2005
Location: Mumbai, India
Model: 8100
Carrier: Airtel
Posts: 31
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
Knows Where the Search Button Is
 
jcomeau_ictx's Avatar
 
Join Date: Dec 2004
Location: Columbus, NM, USA
Model: emu
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
Knows Where the Search Button Is
 
kevin.ross's Avatar
 
Join Date: May 2006
Location: Franklin, Tennessee
Model: 8300
Carrier: AT&T
Posts: 42
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
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


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

New Eaton Vickers EEA-PAM-523-C-32 Power Amplifier
$1299.99
New Eaton Vickers EEA-PAM-523-C-32 Power Amplifier  picture5Pcs CJMCU9812 MAX9812L Electret Microphone Sensor Amplifier Detection Module UE
$12.99
5Pcs CJMCU9812 MAX9812L Electret Microphone Sensor Amplifier Detection Module UE pictureVoice Amplifier Bluetooth Loudspeaker Wire Headset Mic, Voice Saver Waterproof
$57.99
Voice Amplifier Bluetooth Loudspeaker Wire Headset Mic, Voice Saver Waterproof picture4Pcs Copper Crystal Binding Post For Speaker Amplifier 4mm Banana Plug Connector
$7.95
4Pcs Copper Crystal Binding Post For Speaker Amplifier 4mm Banana Plug Connector picture






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