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

Native 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
New Developer
Posts: 41
Registered: ‎02-11-2010
My Device: Bold 9000
My Carrier: AT&T

Load images in webview from app resources?

Im working on an app that has mulitple images as a core element, and are to be processed inside a webview. 

 

however they will not display inside the webview.

 

My file structure is something like this:

 

assets

       images

             custom-images

       webview

 

Do i have to reference the images in relation to the webview folder, or can I reference them from the root app images folder? if so how?

Developer
Posts: 285
Registered: ‎08-06-2010
My Device: Z10

Re: Load images in webview from app resources?

I think you should be able to access them using the "../images/custom-images/" path.



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Developer
Posts: 96
Registered: ‎06-05-2012
My Device: Developer
My Carrier: Developer

Re: Load images in webview from app resources?

Hi,

You can use below line to access images from assest folder.

<img src="local:///assets/images/custom-images/webview/myImage.png" alt="My Image" />

Thanks,
Anand Sharma.


Thanks,
Anand Sharma.
Highlighted
Developer
Posts: 24
Registered: ‎05-16-2013
My Device: Developer
My Carrier: Developer

Re: Load images in webview from app resources?

[ Edited ]

An easy way to include local images in  Webview  is to use encoded images. You can encode an image here.

Here you needn't have to save your image in your asset folder instead it contained within your hml code itself.