Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi I wrote a canvas animation using htlm5 and JavaScript. The motion is almost normal when running on my windows browser. But when I build it and run it on blackberry mobile, the motion decrease may ten times less faster. How can I do for that performance?
The more, I am using the form input to let users modify sizes of the graphics. But as soon as the values are modified in the text box, the graph is resized. How can I do to resize it only when the button is clicked?
Posted

1 solution

Part A - Slow Blackberry performance
When you say that the motion is 'almost normal' when running on a desktop, does this mean that the motions is still somewhat sluggish?

Checking out the benchmarks found here: http://www.roylongbottom.org.uk/android%20benchmarks.htm[^] (Yes - I know a blackberry isn't an android - look for QU-S4 figures - Qualcomm SnapDragon4 - the cpu found in newer blackberries)
We can see that the power of the snapdragon is capable of speeds upto about 300 MLPOS, while a Core I3 as found in this laptop has speeds of about 2710 MFLOPS as measured by MAXFlops.

Straight away, one can see that there IS about 10x the processing power in this laptop over a newish Blackberry.
[EDIT: On my Huawei Sonic Android phone, I get a similar decrease in Canvas and JavaScript performance when going from desktop -> phone]

Part B - Update in response to button press
It's a bit hard to say without seeing your code. From the sounds of it, you may be checking the value of the text-boxes during your drawing loop. If so, a pair of global variables to hold the dimensions may be helpful. You can initialize the vars and set the values to the text-boxes. From there, instead of submitting the form, you can update the global variables whenever the button is pressed. (After they've been sanity-checked, of course)

If you show your code, you'll likely get a better answer.

EDIT: Dammit! Now I look like a necrophiliac... forgot to check post-date..
 
Share this answer
 
v4
Comments
barneyman 15-Jul-12 18:50pm    
yeah - this thread got resurrected by a spammer over the weekend

good effort tho mate! ;)
enhzflep 15-Jul-12 19:00pm    
Thanks mate. Nothing like a Monday morning!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900