Skip to main content

BlackBerry Paints very slow

6 replies [Last post]
gtagliani
Offline
Joined: 2008-08-26
Points: 0

I´m working with a BlackBerry 8100 doing a graphical application using GameCanvas. Compared whit other devices, the time that it takes to paint the screen is extremly slow. To draw a full screen it takes near a second while a Nokia 6131 with the same application takes less than 200 millisecs to do exactly the same work. Is there any special technique to get a better performance to paint in BlackBerry devices?

Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
viralpl
Offline
Joined: 2008-08-27
Points: 0

you cant use repaint();
because it will use standard Canvas procedure - slow :D

use paint like this :

Graphics myGraphics = getGraphics();

paintElements(myGraphics);
flushGraphics(); //put buffer on screen

gtagliani
Offline
Joined: 2008-08-26
Points: 0

viralpl:

The time that it takes to paint using getGraphics() and flushGraphics() or using repaint() is almost the same. And it continues very slow compared with others devices.

thanks!

sfitzjava
Offline
Joined: 2003-06-15
Points: 0

Do you have multiple threads running?
How are you doing your graphics, meaning to you calculate before hand, and then use the values, or are you performing calculations on the fly?

When you say you are doing a "full screen" drawing, what kinda of stuff are you doing, is it painting an image, or drawing points, or a single gfx.fillRect(x,y,x1,y1); ?

The blackberry device is very strange I have found, especially when it comes to multi-threading, and synchronous blocks. It seems that Blackberrys use a single thread for JavaME, and fake multi-threading.

-Shawn

gtagliani
Offline
Joined: 2008-08-26
Points: 0

>Do you have multiple threads running?

Sometimes there is another thread that is making a communication process. But generally I dont have other threads running.

>How are you doing your graphics, meaning to you calculate before hand, and then use the >values, or are you performing calculations on the fly?

I calculate the most of it before hand. We are working with components, so inside the painting method there are some calls to the component`s methods in order to paint themselves.

>When you say you are doing a "full screen" drawing, what kinda of stuff are you doing, is it painting an image, or drawing points, or a single gfx.fillRect(x,y,x1,y1); ?

We paint using fillRect, drawRect, etc. directly to the Graphics instance of the screen.

>The blackberry device is very strange I have found, especially when it comes to >multi-threading, and synchronous blocks. It seems that Blackberrys use a single thread for JavaME, and fake multi-threading.

Thanks!

gtagliani
Offline
Joined: 2008-08-26
Points: 0

I don´t use calls to serviceRepaint(), only repaint() is used.

irshad
Offline
Joined: 2007-04-27
Points: 0

Can you please make sure that you don't call serviceRepaint() ? if yes , can u remove calls to servicerepaints wherever applicable and observe the behavior .

Thanks.