Moving image over image or change image after 1 sec time period
I want develop an app in Java for S40 (ASHA 501) where I need to move object in background image. I mean lets say an image of anything is moving right to left over background image. So I think I need to use timer.
We can also achieve same by changing background image (which have object placed differently) and make illusion that object is moving from right to left.
But I dont know how to use timer to change image on Java for Asha phones?
If anybody can give me some example code for this, or similar thing would be very helpful and appreciated.
Re: Moving image over image or change image after 1 sec time period
Timer is basically a thread that you can schedule tasks on in different time periods or delays.
All you have to do is create a new TimerTask (and implement its run() method) and schedule it in a timer with any delay you want between activations
in that run() method you can move your x,y parameters that you save for drawing the image and repaint the screen (or maybe you have a different thread to repaint the screen - depanding how your app is build and with which framework)