Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > J2ME Scheduled task?

Reply
Thread Tools

J2ME Scheduled task?

 
 
knocker
Guest
Posts: n/a
 
      09-20-2004
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
 
Reply With Quote
 
 
 
 
JScoobyCed
Guest
Posts: n/a
 
      09-21-2004
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.myApplLaun cher
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 ?!
 
Reply With Quote
 
 
 
 
Darryl L. Pierce
Guest
Posts: n/a
 
      09-23-2004
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 <(E-Mail Removed)>
* @see The Infobahn Offramp <http://mcpierce.mypage.org>
* @quote "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
*/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to cancel one of the scheduled tasks in j2me using Timer snehapshinde@gmail.com Java 0 11-05-2008 10:27 AM
Will application J2ME MIDP 2.0 based of one device run another J2ME MIDP 2.0 device? nishadixit Java 5 06-01-2005 05:40 AM
J2ME/ktoolbar: Send an sms to an emulated J2ME-App Markus Java 4 02-12-2005 01:20 PM
J2ME Lime error 10061 (Re: Help with J2ME Wireless Toolkit) Boldra Java 0 12-03-2003 11:30 AM
Can i using j2me program to download and run other j2me programs in emulator? robin Java 0 07-20-2003 12:59 AM



Advertisments