Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create daemon in j2me?

 
pingkan paula
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, is anyone here knows how to create j2me application that able to run when there's SMS or phonecall ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is called the Push Registry.

Actually I am making an assumption on what you want to do, and think that the best solution for you is to use the Push Registry instead.

Although in other situations like Bluetooth, you need a Daemon thread for the device to listen for incoming Bluetooth connection requests.

Anyway, setDaemon() on the Thread class creates a daemon thread. Exactly like J2SE.

Mark
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,

Daemon threads aren't allowed for J2ME CLDC configurations ...
not sure about CDC, but definitely not for CLDC ...
[ March 13, 2006: Message edited by: Eduardo Marques ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then I wonder how I did that for a two player turned based game that I wrote. Cause I vaguely remember reading that and writing an exam question on that. Just haven't worked with J2ME in about a year, and forget those details.

Mark
[ March 14, 2006: Message edited by: Mark Spritzler ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, now I see what I did. I have a thread, but it is the Bluetooth connection object that uses the acceptAndOpen method of the ServiceConnectionNotifier class. Which is running in a thread, but not a thread set to be daemon.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic