com.googlecode.android_scripting.facade
Class SmsFacade

java.lang.Object
  extended by com.googlecode.android_scripting.jsonrpc.RpcReceiver
      extended by com.googlecode.android_scripting.facade.SmsFacade

public class SmsFacade
extends RpcReceiver

Provides access to SMS related functionality.

Author:
MeanEYE.rcf (meaneye.rcf@gmail.com)

Constructor Summary
SmsFacade(FacadeManager manager)
           
 
Method Summary
 void shutdown()
          Invoked when the receiver is shut down.
 java.lang.Boolean smsDeleteMessage(java.lang.Integer id)
           
 java.util.List<java.lang.String> smsGetAttributes()
           
 JSONObject smsGetMessageById(java.lang.Integer id, JSONArray attributes)
           
 java.lang.Integer smsGetMessageCount(java.lang.Boolean unreadOnly, java.lang.String folder)
           
 java.util.List<java.lang.Integer> smsGetMessageIds(java.lang.Boolean unreadOnly, java.lang.String folder)
           
 java.util.List<JSONObject> smsGetMessages(java.lang.Boolean unreadOnly, java.lang.String folder, JSONArray attributes)
           
 java.lang.Integer smsMarkMessageRead(JSONArray ids, java.lang.Boolean read)
           
 void smsSend(java.lang.String destinationAddress, java.lang.String text)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmsFacade

public SmsFacade(FacadeManager manager)
Method Detail

smsSend

@Rpc(description="Sends an SMS.")
public void smsSend(@RpcParameter(name="destinationAddress",description="typically a phone number")
                                   java.lang.String destinationAddress,
                                   @RpcParameter(name="text")
                                   java.lang.String text)

smsGetMessageCount

@Rpc(description="Returns the number of messages.")
public java.lang.Integer smsGetMessageCount(@RpcParameter(name="unreadOnly")
                                                           java.lang.Boolean unreadOnly,
                                                           @RpcParameter(name="folder")@RpcDefault(value="inbox")
                                                           java.lang.String folder)

smsGetMessageIds

@Rpc(description="Returns a List of all message IDs.")
public java.util.List<java.lang.Integer> smsGetMessageIds(@RpcParameter(name="unreadOnly")
                                                                         java.lang.Boolean unreadOnly,
                                                                         @RpcParameter(name="folder")@RpcDefault(value="inbox")
                                                                         java.lang.String folder)

smsGetMessages

@Rpc(description="Returns a List of all messages.",
     returns="a List of messages as Maps")
public java.util.List<JSONObject> smsGetMessages(@RpcParameter(name="unreadOnly")
                                                                       java.lang.Boolean unreadOnly,
                                                                       @RpcParameter(name="folder")@RpcDefault(value="inbox")
                                                                       java.lang.String folder,
                                                                       @RpcParameter(name="attributes")@RpcOptional
                                                                       JSONArray attributes)
                                          throws JSONException
Throws:
JSONException

smsGetMessageById

@Rpc(description="Returns message attributes.")
public JSONObject smsGetMessageById(@RpcParameter(name="id",description="message ID")
                                                   java.lang.Integer id,
                                                   @RpcParameter(name="attributes")@RpcOptional
                                                   JSONArray attributes)
                             throws JSONException
Throws:
JSONException

smsGetAttributes

@Rpc(description="Returns a List of all possible message attributes.")
public java.util.List<java.lang.String> smsGetAttributes()

smsDeleteMessage

@Rpc(description="Deletes a message.",
     returns="True if the message was deleted")
public java.lang.Boolean smsDeleteMessage(@RpcParameter(name="id")
                                                                java.lang.Integer id)

smsMarkMessageRead

@Rpc(description="Marks messages as read.",
     returns="number of messages marked read")
public java.lang.Integer smsMarkMessageRead(@RpcParameter(name="ids",description="List of message IDs to mark as read.")
                                                                  JSONArray ids,
                                                                  @RpcParameter(name="read")
                                                                  java.lang.Boolean read)
                                     throws JSONException
Throws:
JSONException

shutdown

public void shutdown()
Description copied from class: RpcReceiver
Invoked when the receiver is shut down.

Specified by:
shutdown in class RpcReceiver