J2ME Scheduled task?

K

knocker

Hi

I wonder if there's a way to do a scheduled task that launches an
application to perform a task in j2me?

I have the made a simple application, but I would like to be able to
schedule the work to be done at different times.

In a way it is similar to the alarm on a mobile phone, you set it and
it doesn't alert or query you until the appropriate time.

/Erik
 
J

JScoobyCed

knocker said:
Hi

I wonder if there's a way to do a scheduled task that launches an
application to perform a task in j2me?

I have the made a simple application, but I would like to be able to
schedule the work to be done at different times.

In a way it is similar to the alarm on a mobile phone, you set it and
it doesn't alert or query you until the appropriate time.

/Erik

I don't know any API that does that (you might need to look on a
websearch like google), but it can be done:
- Create your application
- Create a Launcher interface:
public interface Launcher {
public void launch();
}
- Create a launcher for this application:
public class myApplLauncher implements Launcher {
public void launch() {
myAppl ma = new myAppl();
ma.start();
}
- Create a MIDlet that starts a timer and check every second if the time
is the one configured. When it is, launch the launcher implementation.
For this MIDlet, you could have in the JAD file the parameters:
mytimer.launcher.implementation=foo.bar.myApplLauncher
mytimer.executionTime=21/09/2004 01:00:00

The timer MIDlet will get the parameters from the JAD file through
Class.getResourceAsStream() (see J2ME javadoc for that) and then it
doesn't need any hardcoded value.
 
D

Darryl L. Pierce

knocker said:
I wonder if there's a way to do a scheduled task that launches an
application to perform a task in j2me?

That would depend on the device; i.e., there's no way to schedule things
from within a MIDlet to then launch the MIDlet at set times.

--
/**
* @author Darryl L. Pierce <[email protected]>
* @see The Infobahn Offramp <http://mcpierce.mypage.org>
* @quote "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
*/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top