Hi Everyone,
Recently i have started a small J2ME project for my personal use. I have developed J2ME application based on calculations which doesnot require "DELAY". Currently i am facing a problem, where i have to implement a delay between two commands.
The way I want this delay to work is something like this:
form1.append(imageitem);
//delay
//and after changing the image
form1.append(imageitem);
I have tried two ways in implementing this, the first one is:
Thread.sleep(delay);
But the problem i am facing using this is that my application stops for 1 second or so right at the start,this can also be termed as loading time and hence i dont get any delay between changing of pictures.
The second method is;
I made a function named as delay_c which does the following operation:
double i;
for(i=0<=1000000;i++)
{}
//Depending on the clock frequency of the phone i can choose the final limit
But sadly this method is behaving the same way as Thread.sleep. I was wondering if I am missing a trick here, because I used Robot class Delay in JAVA applications, as Robot class is not available in J2ME, I am struggling to solve this delay problem.
By the way i have simulated the application on simulator at first and then tried it on phone and it gives the same result.
Thanks