ch.aplu.gidlet
Class Gidlet.SMSReader

java.lang.Object
  extended by java.lang.Thread
      extended by ch.aplu.gidlet.Gidlet.SMSReader
All Implemented Interfaces:
java.lang.Runnable, javax.wireless.messaging.MessageListener
Enclosing class:
Gidlet

public class Gidlet.SMSReader
extends java.lang.Thread
implements javax.wireless.messaging.MessageListener

Class that creates a SMS server thread based on the Wireless Messaging API (WMA).


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Gidlet.SMSReader(int portnumber)
          Creates a server thread based on the Wireless Messaging API (WMA) that looks for incoming SMS.
 
Method Summary
 void notifyIncomingMessage(javax.wireless.messaging.MessageConnection mc)
          For internal use only.
 void run()
          For internal use only.
 void stop()
          Stops the SMSReader thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gidlet.SMSReader

public Gidlet.SMSReader(int portnumber)
Creates a server thread based on the Wireless Messaging API (WMA) that looks for incoming SMS. The callback method notifyIncomingSMS() is triggered at every received SMS. You must specify a port number 0..65565 that corresponds to the sender port number (SMS without a port number are captured by the default SMS application and cannot be intercepted by a MIDlet). To stop the thread, call stop().

See Also:
Gidlet.notifyIncomingSMS(javax.wireless.messaging.TextMessage)
Method Detail

notifyIncomingMessage

public void notifyIncomingMessage(javax.wireless.messaging.MessageConnection mc)
For internal use only.

Specified by:
notifyIncomingMessage in interface javax.wireless.messaging.MessageListener

stop

public void stop()
Stops the SMSReader thread.

Overrides:
stop in class java.lang.Thread

run

public void run()
For internal use only.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread