Speed of graphic operations

mhc

Member
Licensed User
Longtime User
Hi,

I have tried to find out some aspects of the speed of graphic operations.
Please see attached file.
At this time I still have no android device. So I can test B4A only with the emulator.
This small test app should show a small animated graphic which looks like a rising flame.
But it is so slow! :(( The same app written in B4ppc, eVB and Delphi shows the behaviour as expected).
My question:
1: Is my program code totally wrong for B4A?
2: Maybe the reason found in the emulator?
3: Could someone test it on a device and give some feedback?

Thanks

mhc
 

Attachments

  • Flame.zip
    5.6 KB · Views: 200

Erel

B4X founder
Staff member
Licensed User
Longtime User
The emulator is significantly slower than real device.
It looks much better on a real phone (Nexus One).
Note that you should invalidating the activity is an expensive operation. You should only do it once per timer tick. And you can invalidate a certain rectangle instead of the whole activity.

You should declare the variables. Otherwise they are treated as strings and converted all the time to numbers.
 

moster67

Expert
Licensed User
Longtime User
I tried it on my HTC HD2 (1gh processor) running Android and sparkles are much faster (changing shapes) compared to the emulator.

Nice!
 
Top