• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multi-Threading in J2ME

 
Aamir Chaudhry
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use multithread as in J2SE
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic