public class MessageConnectionHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
APPSTATUSFLAG_INTERRUPTED_BY_WMA_SMS |
MessageConnection |
open_connection
When a messagelistener is created, this will be the connection created to support it
|
Constructor and Description |
---|
MessageConnectionHandler() |
Modifier and Type | Method and Description |
---|---|
void |
checkForMessageConnections()
Checks to see if we have any incoming messages.
|
void |
closeMessageListener()
Closes the message listener
|
void |
getInformationFromMessageConnection(MessageConnection mcon)
Interprets the given message-connection and, if valid, calls the appropriate receivedTextMessage or receivedBinaryMessage method with its data.
|
void |
notifyIncomingMessage(MessageConnection mcon)
Detects incoming messages.
|
void |
openMessageListener()
Opens up a message listener.
|
void |
receivedBinaryMessage(java.lang.String senders_number,
byte[] data)
Override these methods with callbacks of your own
|
void |
receivedTextMessage(java.lang.String senders_number,
java.lang.String text)
Override these methods with callbacks of your own
|
boolean |
sendMessage(java.lang.String recipient,
int port,
java.lang.String text,
byte[] data)
Sends a text or binary message to another phone
|
public static final int APPSTATUSFLAG_INTERRUPTED_BY_WMA_SMS
public MessageConnection open_connection
public void receivedTextMessage(java.lang.String senders_number, java.lang.String text)
public void receivedBinaryMessage(java.lang.String senders_number, byte[] data)
public boolean sendMessage(java.lang.String recipient, int port, java.lang.String text, byte[] data)
recipient
- The phone number of the recipientport
- And optional port number that will initiate an app at the destination (-1 otherwise)text
- The text to send or...data
- ...the binary datapublic void notifyIncomingMessage(MessageConnection mcon)
public void getInformationFromMessageConnection(MessageConnection mcon)
public void checkForMessageConnections()
public void openMessageListener()
public void closeMessageListener()