BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-03-2011, 01:04 AM   #1
harraisss
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Default Local html imgae referenc is not working

Please Login to Remove!

HI,
I my blackberry native application i am calling local html file (in part of my package), also i have image reference in that local html file. I am able to show the html file in web view but its not rendering the image.
I have image and html file under SRC folder.

I am using beloe code for rendering the local html file in webview
try {
// Open the connection and the input stream. Select your own
// URL.
//HttpConnection connection = (HttpConnection) Connector.open("http://www.blackberry.com:80");
//InputStream input = connection.openInputStream();
InputStream input = getClass().getResourceAsStream(weburl);


DataBuffer buffer = new DataBuffer();
byte[] temp = new byte[1024];
// Read in the web page to the DataBuffer.
for (;;) {
int bytesRead = input.read(temp);
if (bytesRead == -1) {
break;
}
buffer.write(temp, 0, bytesRead);
}
input.close();
//connection.close();
// Create an output stream that will be used by the Base64 code.
ByteArrayOutputStream output = new ByteArrayOutputStream();
Base64OutputStream boutput = new Base64OutputStream(output);
// Write out the special sequence which indicates to the browser
// that it should treat this as HTML data in base64 format.
output.write("data:text/html;base64,".getBytes());
boutput.write(buffer.getArray());
boutput.flush();
boutput.close();
output.flush();
output.close(); // Invoke the browser with the encoded HTML
// content.
BrowserSession bSession = Browser.getDefaultSession();
bSession.displayPage(output.toString());
} catch (IOException e) {
System.out.println("IOException: " + e);
}
Please help me out on this.
Thanks in advance.
Offline  
Old 05-03-2011, 07:48 AM   #2
harraisss
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Default Re: Local html imgae referenc is not working

Guys any updates ?
Offline  
Old 05-05-2011, 05:21 AM   #3
harraisss
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Default Re: Local html imgae referenc is not working

can someone help me out this ?
I am trying it for the past 2 days.. but no luck :(
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

Similar Threads for: Local html imgae referenc is not working
Thread Thread Starter Forum Replies Last Post
How do I view local HTML files? greg777 General BlackBerry Discussion 6 05-14-2007 04:00 PM
How do I view local HTML files? greg777 Developer Forum 1 05-04-2007 09:16 PM
Google Local causing Battery Drain? dougie360 General Legacy Device Discussion 6 07-23-2006 09:08 PM
Google Local not working whodey1991 General Legacy Device Discussion 6 02-07-2006 12:43 PM
How to View Local HTML page Riteshnewal General BlackBerry Discussion 0 05-12-2005 01:08 AM


New ADVANTECH PCA-6751 Motherboard picture

New ADVANTECH PCA-6751 Motherboard

$247.63



1pcs  Dahua 16 Road Network DVR Motherboard 40_071 80146782 N1414 picture

1pcs Dahua 16 Road Network DVR Motherboard 40_071 80146782 N1414

$99.00



Used & Tested ADVANTECH AIMB-742 REV A1 AIMB-742VE Motherboard picture

Used & Tested ADVANTECH AIMB-742 REV A1 AIMB-742VE Motherboard

$281.13



MAGNETIC AUTOCONTROL   BARRIER GATE MOTHERBOARD  1013.5036 / 10135036 picture

MAGNETIC AUTOCONTROL BARRIER GATE MOTHERBOARD 1013.5036 / 10135036

$325.95



Honeywell Access Controller Motherboard PRO42IC - NIB **  ** picture

Honeywell Access Controller Motherboard PRO42IC - NIB ** **

$850.00



Xerox 140N63475 Mother Board Door 2 (*) picture

Xerox 140N63475 Mother Board Door 2 (*)

$126.00







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