Package totalcross.telephony
Class SmsManager
- java.lang.Object
-
- totalcross.telephony.SmsManager
-
public class SmsManager extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SmsManagergetDefault()Get the default SmsManager.voidregisterSmsReceiver(SmsReceiver receiver)Registers a receiver to listen for incoming text sms messagesvoidregisterSmsReceiver(SmsReceiver receiver, int port)Registers a receiver to listen for incoming sms messagesvoidsendDataMessage(java.lang.String destinationAddress, java.lang.String scAddress, int port, byte[] data)Send a data based SMS to a specific application port.voidsendTextMessage(java.lang.String destinationAddress, java.lang.String scAddress, java.lang.String text)Send a text based SMS.
-
-
-
Method Detail
-
getDefault
public static SmsManager getDefault()
Get the default SmsManager.
-
registerSmsReceiver
public void registerSmsReceiver(SmsReceiver receiver, int port)
Registers a receiver to listen for incoming sms messages- Parameters:
receiver- the receiver that will handle incoming sms messages or null to stop listening incoming messagesport- the port to listen for incoming sms messages - required for data sms messages, pass -1 to listen on default port for text messages
-
registerSmsReceiver
public void registerSmsReceiver(SmsReceiver receiver)
Registers a receiver to listen for incoming text sms messages- Parameters:
receiver- the receiver that will handle incoming text sms messages or null to stop listening incoming messages
-
sendTextMessage
public void sendTextMessage(java.lang.String destinationAddress, java.lang.String scAddress, java.lang.String text)Send a text based SMS.- Parameters:
destinationAddress- the address to send the message toscAddress- the service center address or null to use the current default SMSCtext- the body of the message to send
-
sendDataMessage
public void sendDataMessage(java.lang.String destinationAddress, java.lang.String scAddress, int port, byte[] data)Send a data based SMS to a specific application port.- Parameters:
destinationAddress- the address to send the message toscAddress- the service center address or null to use the current default SMSCport- the port to deliver the message todata- the body of the message to send
-
-