J2ME Scheduled task?

Discussion in 'Java' started by knocker, Sep 20, 2004.

  1. knocker

    knocker Guest

    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
    knocker, Sep 20, 2004
    #1
    1. Advertising

  2. knocker

    JScoobyCed Guest

    knocker wrote:

    > 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.


    --
    JScoobyCed
    What about a JScooby snack Shaggy ? ... Shaggy ?!
    JScoobyCed, Sep 21, 2004
    #2
    1. Advertising

  3. knocker wrote:

    > 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 <>
    * @see The Infobahn Offramp <http://mcpierce.mypage.org>
    * @quote "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
    */
    Darryl L. Pierce, Sep 23, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Walsh

    Scheduled Task in J2EE

    Ian Walsh, Sep 11, 2004, in forum: Java
    Replies:
    3
    Views:
    3,692
    Wei Jiang
    Sep 13, 2004
  2. SLEEPY LOLO

    Scheduled task

    SLEEPY LOLO, Feb 3, 2005, in forum: C++
    Replies:
    7
    Views:
    680
    Victor Bazarov
    Feb 4, 2005
  3. upin_cool
    Replies:
    0
    Views:
    4,676
    upin_cool
    May 15, 2006
  4. cksanjose

    Scheduled task using timer

    cksanjose, Oct 31, 2007, in forum: Java
    Replies:
    2
    Views:
    328
    Piotr Kobzda
    Oct 31, 2007
  5. Lucho
    Replies:
    5
    Views:
    3,768
    Andreas Leitgeb
    Jan 19, 2008
Loading...

Share This Page