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
Developer
abarber
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: JavaScript runs once but won't continually update

Ok

I created another script that basically does the same thing as you want. It switches an image every second.

 

http://www.cesarcaballeroart.com/IntervalTest3.htm

 

 

 

Now this script works on any device that has an OS > 4.6 so it will work on you 9530 simulator but not the 8330 simulator.

Before v4.6 there is no dynamic refresh of the page, i.e. if you want the page to look different, you need to reload the page again.

1 way of doing this in <4.6 is to cache the page and recall it with different images. That way the speed is reasonable as the page is cached.

 

You will have to upgrade the OS on the actual BB devices to > 4.6 if you want the user to be able to see the page dynamically refreshing.

Please use plain text.
New Developer
NewtownGuy
Posts: 22
Registered: ‎05-14-2009
My Device: Not Specified

Re: JavaScript runs once but won't continually update

Hi Abarber,

 

Thank you again, this time for the sample script. One key difference that I see with my script is that I'm loading a new JPEG image each time to produce video, so this takes a lot more communications and cpu power than changing gif's. My customer ran a test on his 8830 and his download speed was less than 60 Kbps, greatly slowing things down. At that rate, his BB requires several seconds per frame (using refresh not JavaScript), which is too slow to run my 1 frame per second test code.

 

I still need to fix the 9530 to handle JavaScript. The browser configuration looks ok to me. How do I attach the screen shots you requested to this post ?

 

What is required to update the 8830 (currently 4.3 in the simulator) to be able to handle dynamically changing images ? If this solves the problem in the simulator,what is required for a customer to update, too ? How risky is the update for the customer ?

 

Please try this link again to check my code: http://24.2.212.254:8080/test-BB1000.html. Please note that the simulator may not be able to keep up with a new image at the rate of 1 frame per second.

 

 

Please use plain text.
New Developer
NewtownGuy
Posts: 22
Registered: ‎05-14-2009
My Device: Not Specified

Re: JavaScript runs once but won't continually update

[ Edited ]

The 9530 Simulator is unreliable !

 

If I reboot my PC, I can get Abarber's IntervalTest3.htm to work ok.

 

But if I load one of my scripts, the simulator BB browser hangs. If I then reload IntervalTest3.htm, it sticks on the first image -- it's broken. Restarting the 9530 and MDS simulators does not solve the problem. Also, all the browsing history is lost.

 

I have three browsers side by side on the same machine, all trying to run IntervalTest3.htm:

 

1) IE6 -- works ok

 

2) FF3 -- works ok

 

3) BB -- doesn't work most of the time

 

What can I do to make the 9350 simulator process JavaScript better ? I can't tell if the problem is with my script or the simulator.

 

 

 

Message Edited by NewtownGuy on 05-19-2009 02:53 PM
Please use plain text.
New Developer
NewtownGuy
Posts: 22
Registered: ‎05-14-2009
My Device: Not Specified

Re: JavaScript runs once but won't continually update

PROBLEM IN BB BROWSER CACHE FOUND

 

I gave up on the simulator for the 9530 and tried the 8900. The 8900 simulator works. I discovered that the browser cache does not work right. It ignores the URL-encoded string that I append to each image request, thus my script keeps getting the same image from cache rather than using the changing URL-string to differentiate successive images. Since I'm trying to view live video, not a few GIF's, this bug killed my video.

 

I found this after checking my page in FF Error Console and FF Firebug. Both reported ZERO errors in my current page. My original page had minor errors, such as a missing ";" but the primary problems were: (a) inadequate JavaScript support in 8830, and defective JavaScript support in 9530.

 

 How can I, and my customer, upgrade JavaScript in 8830 to the level that handles timers ?

 

 

Please use plain text.
Guru I
Xandrex
Posts: 18,379
Registered: ‎07-29-2008
My Device: Z10 10.1.0.2312 / Playbook 2.1 / 8900 5.0
My Carrier: Vodafone France (SFR) & B&You

Re: JavaScript runs once but won't continually update


NewtownGuy wrote:

How do I attach the screen shots you requested to this post ?


When you type a message, under the [Post] and [Cancel] you have a "Add Attachments" link.


NewtownGuy wrote:

What is required to update the 8830 (currently 4.3 in the simulator) to be able to handle dynamically changing images ?


To this day, the 8830 device can get an upgrade of the OS, up to version 4.5 only.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Please use plain text.
New Developer
NewtownGuy
Posts: 22
Registered: ‎05-14-2009
My Device: Not Specified

Re: JavaScript runs once but won't continually update

OS 4.5 is not high enough to update the screen without refreshing the screen, I take it...

 

 

If I have to refresh the screen to update each video image, what's the best way to do it ? Can I keep a new image in memory so I can immediately put it on the screen so the screen is not blank for long ? What's the least amount of time it would take to refresh the screen and put a new 320x240, or 160x120, JPEG image on it from memory on the 8330 ?

 

 

 

 

 

Please use plain text.
Guru I
Xandrex
Posts: 18,379
Registered: ‎07-29-2008
My Device: Z10 10.1.0.2312 / Playbook 2.1 / 8900 5.0
My Carrier: Vodafone France (SFR) & B&You

Re: JavaScript runs once but won't continually update

if I were you, I would go GIF images. That's the best solution.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
Please use plain text.
New Developer
NewtownGuy
Posts: 22
Registered: ‎05-14-2009
My Device: Not Specified

Re: JavaScript runs once but won't continually update

Why GIF instead of JPG ? For a given resolution, the file size of a GIF image is much larger than for a JPG because we're sending photographs (frames of video), not drawings.
Please use plain text.
Developer
abarber
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: JavaScript runs once but won't continually update

Hello

 

Here is 1 solution. Check it out on the 8830.

 

http://www.cesarcaballeroart.com/ViewerTest/ImgViewerTest3.htm

 

Wait until the image loads, then call the url of the next image.

 

 

Andrew

Please use plain text.
Developer
abarber
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: JavaScript runs once but won't continually update

Also check out this script on the 8830.

 

It loads the next image into memory so it loads a bit quicker.

 

http://www.cesarcaballeroart.com/ViewerTest/ImgViewerTest4.htm

Please use plain text.