public class Texting extends AndroidNonvisibleComponent implements Component, OnResumeListener, OnPauseListener, OnInitializeListener, OnStopListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GV_INTENT_FILTER |
static java.lang.String |
GV_PACKAGE_NAME |
static java.lang.String |
GV_SMS_RECEIVED |
static java.lang.String |
GV_SMS_SEND_URL |
static java.lang.String |
GV_URL |
static java.lang.String |
MESSAGE_TAG |
static java.lang.String |
META_DATA_SMS_KEY |
static java.lang.String |
META_DATA_SMS_VALUE |
static java.lang.String |
PHONE_NUMBER_TAG |
static java.lang.String |
SMS_RECEIVED |
static java.lang.String |
TAG |
static java.lang.String |
TELEPHONY_INTENT_FILTER |
form
ACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF
Constructor and Description |
---|
Texting(ComponentContainer container)
Creates a new TextMessage component.
|
Modifier and Type | Method and Description |
---|---|
static int |
getCachedMsgCount()
Used to keep count in Notifications.
|
static android.telephony.SmsMessage[] |
getMessagesFromIntent(android.content.Intent intent)
Parse the messages out of the extra fields from the "android.permission.RECEIVE_SMS" broadcast
intent.
|
boolean |
GoogleVoiceEnabled()
If this property is true, then SendMessage will attempt to send messages using
Google voice.
|
void |
GoogleVoiceEnabled(boolean enabled)
If this property is true, then SendMessage will attempt to send messages over
WiFi, using Google voice.
|
static void |
handledReceivedMessage(android.content.Context context,
java.lang.String phone,
java.lang.String msg)
This method is called by SmsBroadcastReceiver when a message is received.
|
static int |
isReceivingEnabled(android.content.Context context) |
static boolean |
isRunning()
Called by SmsBroadcastReceiver
|
java.lang.String |
Message()
The text message that will be sent when the SendMessage method is called.
|
void |
Message(java.lang.String message)
The text message to that will be sent when the SendMessage method is called.
|
static void |
MessageReceived(java.lang.String number,
java.lang.String messageText)
Event that's raised when a text message is received by the phone.
|
void |
onInitialize()
Callback from Form.
|
void |
onPause()
Messages received while paused will be cached
|
void |
onResume()
Processes cached messages if the app is initialized
|
void |
onStop()
Save the component's state in shared preference file before it is killed.
|
java.lang.String |
PhoneNumber()
The number that the message will be sent to when the SendMessage method is called.
|
void |
PhoneNumber(java.lang.String phoneNumber)
Sets the phone number to send the text message to when the SendMessage function is called.
|
int |
ReceivingEnabled()
Gets whether you want the
MessageReceived(String,String) event to
get run when a new text message is received. |
void |
ReceivingEnabled(int enabled)
Sets whether you want the
MessageReceived(String,String) event to
get run when a new text message is received. |
void |
SendMessage()
Send a text message
|
getDispatchDelegate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDispatchDelegate
public static final java.lang.String TAG
public static final java.lang.String SMS_RECEIVED
public static final java.lang.String GV_SMS_RECEIVED
public static final java.lang.String PHONE_NUMBER_TAG
public static final java.lang.String MESSAGE_TAG
public static final java.lang.String TELEPHONY_INTENT_FILTER
public static final java.lang.String GV_INTENT_FILTER
public static final java.lang.String GV_PACKAGE_NAME
public static final java.lang.String GV_SMS_SEND_URL
public static final java.lang.String GV_URL
public static final java.lang.String META_DATA_SMS_KEY
public static final java.lang.String META_DATA_SMS_VALUE
public Texting(ComponentContainer container)
container
- ignored (because this is a non-visible component)public void onInitialize()
onInitialize
in interface OnInitializeListener
public void PhoneNumber(java.lang.String phoneNumber)
phoneNumber
- a phone number to callpublic java.lang.String PhoneNumber()
public void Message(java.lang.String message)
message
- the message to send when the SendMessage function is called.public java.lang.String Message()
public void SendMessage()
public static void MessageReceived(java.lang.String number, java.lang.String messageText)
number
- the phone number that the text message was sent from.messageText
- the text of the message.public boolean GoogleVoiceEnabled()
public void GoogleVoiceEnabled(boolean enabled)
enabled
- Set to 'true' or 'false' depending on whether you want to
use Google Voice to send/receive messages.public int ReceivingEnabled()
MessageReceived(String,String)
event to
get run when a new text message is received.MessageReceived(String,String)
event to get run when a
new text message is received.public void ReceivingEnabled(int enabled)
MessageReceived(String,String)
event to
get run when a new text message is received.enabled
- 0 = never receive, 1 = receive foreground only, 2 = receive alwayspublic static int isReceivingEnabled(android.content.Context context)
public static android.telephony.SmsMessage[] getMessagesFromIntent(android.content.Intent intent)
intent
- the intent to read frompublic static boolean isRunning()
public static int getCachedMsgCount()
public void onResume()
onResume
in interface OnResumeListener
public void onPause()
onPause
in interface OnPauseListener
public static void handledReceivedMessage(android.content.Context context, java.lang.String phone, java.lang.String msg)
phone
- msg
- public void onStop()
onStop
in interface OnStopListener