File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes Multi-Threading in J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Multi-Threading in J2ME" Watch "Multi-Threading in J2ME" New topic
Author

Multi-Threading in J2ME

Aamir Chaudhry
Greenhorn

Joined: Dec 10, 2001
Posts: 23
Hi, is it possible to use multi-threads in J2ME/MIDP for Palm? does J2ME support multi-threading? if yes, then how can i use it?
your immediate response would be much appreciated. thanks in advance
Aamir
john muchow
Ranch Hand

Joined: Mar 24, 2001
Posts: 49
Yes, J2ME supports threads. You can use the Runnable interface as you would within J2SE.
class Download implements Runnable
{
...
public void run()
{
// the action here...
}
public void start()
{
// Create/start thread
Thread t = new Thread(this);
...
thread.start();
...
}
}
// Create instance of class
Download dl = new Download();
dl.start();

John
Author Core J2ME Technology and MIDP
Core J2ME Developer Website
Ding Ding
Greenhorn

Joined: Feb 07, 2002
Posts: 7
You can use multithread as in J2SE
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multi-Threading in J2ME