Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to 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 21-Apr-11 7:10am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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..
  Permalink  
v4
Comments
barneyman at 15-Jul-12 18:50pm
   
yeah - this thread got resurrected by a spammer over the weekend
 
good effort tho mate! ;)
enhzflep at 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)

  Print Answers RSS
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,614
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 15 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100