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

Java Development

Reply
New Contributor
binli120
Posts: 9
Registered: ‎08-16-2010
My Device: Not Specified
Accepted Solution

Browser Field image rendering on device

Hey experts,

I tried to use BrowserFieldDemo for rending a web contents from remote web server. However, image content shows image placeholder and image never render correctly on device. The simulator is fine. I make sure the getResource() image download code is right place. I am running sdk 4.6.0. Here is renderOptions:

 

_renderingSession.getRenderingOptions().setProperty(
RenderingOptions.CORE_OPTIONS_GUID,
RenderingOptions.JAVASCRIPT_ENABLED, true);
_renderingSession.getRenderingOptions().setProperty(
RenderingOptions.CORE_OPTIONS_GUID,
RenderingOptions.SHOW_IMAGES_IN_HTML, true);
_renderingSession.getRenderingOptions().setProperty(
RenderingOptions.CORE_OPTIONS_GUID,
RenderingOptions.ENABLE_CSS, true);
_renderingSession.getRenderingOptions().setProperty(
RenderingOptions.CORE_OPTIONS_GUID,
RenderingOptions.ENABLE_EMBEDDED_RICH_CONTENT, true);
// RenderingOptions.ENABLE_EMBEDDED_RICH_CONTENT
Font defaultFont = Font.getDefault().derive(Font.BOLD, 8);
_renderingSession.getRenderingOptions().setProperty(
RenderingOptions.CORE_OPTIONS_GUID,
RenderingOptions.DEFAULT_FONT_FACE,
defaultFont.getFontFamily().getName());
_renderingSession.getRenderingOptions().setProperty(
RenderingOptions.CORE_OPTIONS_GUID,
RenderingOptions.DEFAULT_FONT_SIZE,
String.valueOf(_parent.getFontSize()));

 

_renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true); _renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.SHOW_IMAGES_IN_HTML, true); _renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_CSS, true); _renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ENABLE_EMBEDDED_RICH_CONTENT, true); // RenderingOptions.ENABLE_EMBEDDED_RICH_CONTENT
Font defaultFont = Font.getDefault().derive(Font.BOLD, 8); _renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.DEFAULT_FONT_FACE, defaultFont.getFontFamily().getName()); _renderingSession.getRenderingOptions().setProperty( RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.DEFAULT_FONT_SIZE, String.valueOf(_parent.getFontSize())); 

 

What I need to do to be able render image automatically?

 

Thanks in advanced.

Please use plain text.
New Contributor
binli120
Posts: 9
Registered: ‎08-16-2010
My Device: Not Specified

Re: Browser Field image rendering on device

Hey is there anybody to help me out

Please use plain text.
New Contributor
binli120
Posts: 9
Registered: ‎08-16-2010
My Device: Not Specified

Re: Browser Field image rendering on device

I finally figure it out that image download connection method are different with html download connection. When I test on simulator, I am using MDS by default, one device I was testing through WIFI and could not make connection on image download

Please use plain text.