please look this code , when i run it on nokia N97 it`s run very slow but i test it on samsung corby it`s run true , i think if i use game canvas problem be sloved . what should i do to solve this problem .

 * To change this template, choose Tools | Templates
 * and open the template in the editor.

import java.io.IOException;
import javax.microedition.lcdui.*;

 * @author mahdi
public class MIDPCanvas extends Canvas implements Runnable {

    Graphics g;
    Image img;
    int x = getWidth() / 2;
    Display display;

    public MIDPCanvas(Display display) {

        this.display = display;
        try {
            img = Image.createImage("/pic.jpg");
        } catch (IOException ex) {

    protected void paint(Graphics g) {
        g.drawImage(img, x, getHeight() / 2, Graphics.VCENTER | Graphics.HCENTER);

    public void run() {
        try {
        } catch (InterruptedException ex) {

its run on wtk very fast but in other emulator like LG or nokia its slow

I don't know anything about these phones but I've been tracking CPU use in a phone drawing program, and one key thing to control is number of times you repaint the screen. also if you repaint, if possible specify the rectangle to repaint in, repaint by itself draws the whole screen.


as already pointed out by adams you are refreshing your graphic to much (actually 100 times per second). You should do it something about 15-20 times per second, but may be even less...
Do not relay on emulator as hat is using your processor and it will much faster then real device