Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.skype.api
Class Sms

    java.lang.Object
      com.skype.api.SkypeObject
          com.skype.api.Sms

    public class Sms

extends SkypeObject

Wrapper class that includes SMS-specific properties and methods, such as P_BODY and GetTargetPrice. Instantiate SMS instances using Skype.CreateOutgoingSms; post SMS messages to a Conversation using Conversation.PostSMS.
Each SMS can have multiple targets (normalized phone numbers). Note that in a Conversation context, every SMS instance has a corresponding Message instance. Once you've posted an SMS, you can retrieve its corresponding Message instance using Sms.GetPropChatmsgId. That Message instance's P_BODY_XML property contains the SMS message data, such as price, target phone number(s), failure codes, and so forth, which you can parsed out and display in the UI. To put it another way, the object chain goes like this:
@code
Conversation->Message->SMS
Note that SkypeKit SDK supports outgoing SMS messages only. SkypeKit clients, even when logged in with accounts that have SkypeIn numbers, cannot receive SMS messages.

Nested Class Summary
`static class` | `Sms.CONFIRM_TYPE`
`static class` | `Sms.FAILUREREASON`
`class` | `Sms.GetBodyChunksResult`
`static class` | `Sms.PROPERTY` Properties of the Sms class
`static class` | `Sms.SETBODYRESULT`
`class` | `Sms.SetSMSBodyResult`
`static interface` | `Sms.SmsListener`
`static class` | `Sms.STATUS`
`static class` | `Sms.TARGETSTATUS`
`static class` | `Sms.TYPE`

Field Summary

Fields inherited from class com.skype.api.SkypeObject
`mObjectId, mPropCache, skype`

Constructor Summary
`Sms(int oid, Skype skype)`

Method Summary
`byte[]` | `GetBinProperty(Sms.PROPERTY prop)`
`Sms.GetBodyChunksResult` | `GetBodyChunks()` Retrieves string list of SMS text chunks in first argument, while the second argument contains the number of available characters until creation of the next chunk becomes necessary.
`boolean` | `GetBooleanProperty(Sms.PROPERTY prop)`
`int` | `GetIntProperty(Sms.PROPERTY prop)`
`java.lang.Object` | `GetPropertyAsEnum(int propid)`
`java.lang.String` | `GetStrProperty(Sms.PROPERTY prop)`
`int` | `GetTargetPrice(java.lang.String target)` Retrieves the amount of Skype credit necessary to send the SMS to a particular recipient.
`Sms.TARGETSTATUS` | `GetTargetStatus(java.lang.String target)` Retrieves the send status of this SMS to a particular recipient (P_TARGET_STATUSES) either prior to or after invoking Conversation.PostSMS.
`static int` | `moduleID()`
`Sms.SetSMSBodyResult` | `SetBody(java.lang.String text)` -The- method for setting the body text of this SMS.
`boolean` | `SetTargets(java.lang.String[] numbers)` Sets the recipient(s) of this SMS.

Methods inherited from class com.skype.api.SkypeObject
`close, getOid`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Sms

    public Sms(int oid,
               Skype skype)

Method Detail

### moduleID

    public static final int moduleID()

### GetPropertyAsEnum

    public java.lang.Object GetPropertyAsEnum(int propid)

  Specified by:
    `GetPropertyAsEnum` in class `SkypeObject`

### GetStrProperty

    public java.lang.String GetStrProperty(Sms.PROPERTY prop)

### GetIntProperty

    public int GetIntProperty(Sms.PROPERTY prop)

### GetBooleanProperty

    public boolean GetBooleanProperty(Sms.PROPERTY prop)

### GetBinProperty

    public byte[] GetBinProperty(Sms.PROPERTY prop)

### GetTargetStatus

    public Sms.TARGETSTATUS GetTargetStatus(java.lang.String target)

  Retrieves the send status of this SMS to a particular recipient (P_TARGET_STATUSES) either prior to or after invoking Conversation.PostSMS.

  Parameters:
    `target` - The normalized phone number of the target recipient.
  Returns:
    status The send status of the target recipient, for example, TARGET_ANALYZING, TARGET_DELIVERY_PENDING, TARGET_DELIVERY_SUCCESSFUL, TARGET_DELIVERY_FAILED, and so forth. TARGET_UNDEFINED implies that the specified target is not a recipient of this SMS.

### GetTargetPrice

    public int GetTargetPrice(java.lang.String target)

  Retrieves the amount of Skype credit necessary to send the SMS to a particular recipient. Defaults to -1 on instantiation and set only when that recipient's status reflects TARGET_ACCEPTABLE. Use Sms.GetPropPrice to retrieve the total cost of this SMS.
  Note that the target price is an integer value. Calculate the actual price (in units specified by P_PRICE_CURRENCY) using P_PRICE_PRECISION as:
  @code
  actualTargetPrice = targetPrice / 10^pricePrecision;

  Parameters:
    `target` - The normalized phone number of the target recipient.
  Returns:
    price The price of sending this SMS message to the target recipient.

### SetTargets

    public boolean SetTargets(java.lang.String[] numbers)

  Sets the recipient(s) of this SMS. Note that each invocation replaces the target list and re-calculates all prices - they are not additive!

  Parameters:
    `numbers` - Normalized phone number(s) of the intended recipient(s).
  Returns:
    success Set to true if the target list appears to contain valid, normalized telephone numbers. Note that this check is not very reliable. Actual target validity checking occurs asynchronously in the background, and manifests itself as a series of Sms.P_TARGET_STATUSES property change events.

### SetBody

    public Sms.SetSMSBodyResult SetBody(java.lang.String text)

  -The- method for setting the body text of this SMS. While Conversation.PostSMS does have a body argument, that argument is currently unused.

  Parameters:
    `text` - Message body text.
  Returns:
    SetSMSBodyResult

### GetBodyChunks

    public Sms.GetBodyChunksResult GetBodyChunks()

  Retrieves string list of SMS text chunks in first argument, while the second argument contains the number of available characters until creation of the next chunk becomes necessary.

  Returns:
    GetBodyChunksResult

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010, 2011 Skype Technologies. All Rights Reserved.