If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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

Web and WebWorks Development

Reply
New Contributor
bb_widget
Posts: 2
Registered: ‎03-30-2011
My Device: Curve 8520
My Carrier: Movistar

Widget - load time problem

Hi,

I've developed a widget that tries to load a remote web page. The problem I'm having is that it takes too much time to load the page.

If I load the same page using BB web browser, loading time is ok, but if I load the page using the widget it takes more than 1 minute.

I've tried using different web pages, but the problem remains.

Cache feature is disabled, and I need it to be disabled: <rim: cache disableAllCache="true"/>

Blackberry Curve 8520 - OS 5.0.0.1036

Any ideas of what should be the problem?

Thanks in advance

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Widget - load time problem

First thing to mention is that if you disable the cache you will be retrieving the content every time from the server and you won't be able to take advantage of previously fetched files.  This will cause your page to render slower.

 

There is also a setting in the framework template code for a WebWorks app that waits for an entire page to finish loading before it appears on the screen.  This can cause the appearance of a slower loading page because the browser shows progressive rendering where a webworks app waits for all the content before painting.

 

If you are adventurous, you can make a small change in your WebWorks template files to see if it gives you the affect you are looking for.

 

Step 1) Backup your template files

Typically they are found in:

[DRIVE]:\InstallDir\BlackBerry WebWorks Packager\device_templates

 

Step 2) Open up the desired Java file

The file you are looking for is BrowserFieldScreen.java

 

I believe it is located at "framework/src/blackberry/web/widget/bf/BrowserFieldScreen.java" in the "device_templates" directory.

 

Step 3) Edit the Paint Method

Locate the paint method in this file and comment out the lines shown below

 

 

/* Paints a bgcolor if the page is not loaded yet. */
    protected void paint(Graphics graphics) {
       // if(_loaded){            
            super.paint(graphics);
       // }
    }

 

 

Step 4) Save and re-compile

Save this file and then re-compile your application to see if it makes a difference.

 

This will allow the content to paint while it is being loaded.  I'm not sure if it will give you the desired results, but it may be worth a shot.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Contributor
bb_widget
Posts: 2
Registered: ‎03-30-2011
My Device: Curve 8520
My Carrier: Movistar

Re: Widget - load time problem

Hi tneil,

 

First of all thanks for your answer.

I need to disable the cache for the user can view in real time the effect of his actions.

I have tried to make the change that you comment in your post, but the loading time remains the same.

As I said in my first post, if I load the same page using BB web browser, loading time is ok, but if I load the page using the widget it takes more than 1 m, which is inadmissible.

Why occurs this difference  in the load time?

 

Thanks in advance

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Widget - load time problem

Are you loading content over SSL?

 

The BlackBerry Browser uses an entirely different set of communications off of the device than any other application.  WebWorks apps and Java apps do not get to use this communications transport.  The Browser's connection has had multiple different optimizations to it.

 

From a rendering speed and JavaScript speed WebWorks will be the same as the Browser.  The speed difference comes from retrieving the content itself.

 

Typically I've seen a 20-30% speed differenct between the browser and a WebWorks app for retrieving remote content.  However, we do have some reports that if this is over SSL there may be some additional overhead that we are investigating.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Contributor
darmie
Posts: 3
Registered: ‎10-07-2013
My Device: Bold5
My Carrier: MTN

Re: Widget - load time problem

[ Edited ]

Hi Tim Neil, I am currently developing a blackberry webworks app. I used setTimeout to make multi-pages load faster. but when i navigate through pages it shows a blank white screen for a few seconds before it renders the page. is there anyway i could eradicate the white blank screen?

Please use plain text.