BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-03-2011, 02:04 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
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, 08:48 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Local html imgae referenc is not working

Guys any updates ?
Offline  
Old 05-05-2011, 06:21 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2009
Model: 8300
PIN: N/A
Carrier: developer
Posts: 37
Post Thanks: 0
Thanked 0 Times in 0 Posts
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


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

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 05:00 PM
How do I view local HTML files? greg777 Developer Forum 1 05-04-2007 10:16 PM
Google Local causing Battery Drain? dougie360 General Legacy Device Discussion 6 07-23-2006 10: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 02:08 AM





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