Successfully reported this slideshow.

Scmad Chapter10

1,604 views

Published on

Chapter 10 - SCMAD Study Guide.
WMA . Only for studies purposes.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Scmad Chapter10

  1. 1. By Marcel Caraciolo http://mobideia.blogspot.com Chapter 10– Wireless Messaging API SCMAD Certification 45mm 61mm
  2. 2. Agenda <ul><li>WMA </li></ul><ul><ul><li>Wireless Messaging API </li></ul></ul><ul><ul><li>Messaging Connector </li></ul></ul><ul><ul><li>Message Types </li></ul></ul><ul><ul><li>Classes </li></ul></ul><ul><ul><li>Permissions </li></ul></ul>
  3. 3. WM WMA – Wireless Messaging API <ul><li>API for sending and receiving mobile phone messages (SMS, MMS, etc.) </li></ul><ul><li>Defined over GCF </li></ul><ul><li>Similar to datagram, but uses different API: </li></ul><ul><li>javax.microedition.messaging </li></ul><ul><li>Messages may be: </li></ul><ul><ul><li>Text Message (sends String though SMS messages) </li></ul></ul><ul><ul><li>Binary Message (sends byte arrays over SMS messages) </li></ul></ul><ul><ul><li>MultipartMessage (MMS, only available at WMA 2.0) </li></ul></ul><ul><li>Message infrastructures usually are “store-and-forward” : if the destination device is not available when the message is sent, it may be delivered later. </li></ul>
  4. 4. WM WMA – Wireless Messaging API <ul><li>Messages are composed of: </li></ul><ul><ul><li>An address (may be destination or origin address, according to the context) </li></ul></ul><ul><ul><li>A TimeStamp from when it was sent </li></ul></ul><ul><ul><li>“ Payload” itself </li></ul></ul><ul><li>It’s a protocol-independent API, but has the same QOS of the protocol </li></ul><ul><li>Sending a message is usually billed, so this must be considered when designing the application </li></ul><ul><li>Like any network operation, messages must be sent and received on a separate thread </li></ul>
  5. 5. M Message Connection <ul><li>Extends Connection: Although very similar to datagrams , SMS messages are not considered datagrams </li></ul><ul><li>Created using Connector.open( “sms://[phoneNumber]:[:port]” ) </li></ul><ul><li>If no port is informed, the message will be sent to the device’s inbox. If it’s informed, it’s sent to an application waiting on that port. It’s impossible to access or intercept messages sent to the inbox </li></ul><ul><li>Trying to open streams (e.g. Connector.openOutputStream()) with WMA protocols throws an exception since these protocols are not stream-oriented </li></ul>
  6. 6. M Message Connection <ul><li>There are “client” and “server” connections: </li></ul><ul><ul><li>Client : “sms: //12345678:1234”  Can only send messages to this number </li></ul></ul><ul><ul><li>Server: “sms://:1234”  Can send messages to any number and also receive messages. Server connections must always inform a port number. </li></ul></ul>
  7. 7. M Message Connection <ul><li>MessageConnection object works as: </li></ul><ul><ul><li>Factory Method for creating messages (newMessage(type), newMessage(type, address)) </li></ul></ul><ul><ul><li>Sending messages </li></ul></ul><ul><ul><li>Receiving messages </li></ul></ul><ul><ul><li>Calculating how many segments a message will consume (a message may be larger than the maximum size supported by the protocol. In this case several messages are sent and re-organized by the receiver) </li></ul></ul><ul><ul><li>MessageListener may be registered to notify message arrivals </li></ul></ul>
  8. 8. M Message Types <ul><li>SMS (Short message service): </li></ul><ul><ul><li>Supports 140 bytes payload. The number of character per message depends on the encoding: </li></ul></ul><ul><ul><ul><li>7 Bits: 160 characters </li></ul></ul></ul><ul><ul><ul><li>8 Bits: 140 characters </li></ul></ul></ul><ul><ul><ul><li>16 Bits: 70 characters </li></ul></ul></ul><ul><ul><li>WMA allows sending messages bigger than allowed by the protocol (sending several messages (segments)). Devices must support messages with at least 3 segments (420 bytes). </li></ul></ul>
  9. 9. M Message Types <ul><li>CBS(Cell broadcast service): </li></ul><ul><ul><li>Messages may only be received (broadcast). You cannot open CBS connections in “client” mode or send CBS messages </li></ul></ul>
  10. 10. M WMA: Class Diagram
  11. 11. WMA: Permissions <ul><li>javax.microedition.io.Connector.sms </li></ul><ul><li>javax.microedition.io.Connector.cbs </li></ul><ul><li>javax.microedition.io.Connector.mms </li></ul><ul><li>javax.wireless.messaging.sms.send </li></ul><ul><li>javax.wireless.messaging.sms.receive </li></ul><ul><li>javax.wireless.messaging.cbs.receive </li></ul>
  12. 12. Example Codes <ul><li>Some examples and MIDlets samples are available for reference and studying at this link: </li></ul><ul><ul><li>http://www.dsc.upe.br/~ mpc/chapter10.rar </li></ul></ul><ul><li>The source codes include: </li></ul><ul><ul><li>SMSMIDlet </li></ul></ul>
  13. 13. Future Work <ul><li>Next Chapter: </li></ul><ul><ul><li>MIDP - Deployment </li></ul></ul><ul><ul><ul><li>MIDlet Suites </li></ul></ul></ul><ul><ul><ul><li>JAD Descriptor </li></ul></ul></ul><ul><ul><ul><li>OTA Provisioning </li></ul></ul></ul><ul><ul><li>MIDP – Push Registry </li></ul></ul><ul><ul><ul><li>Push Registry </li></ul></ul></ul><ul><ul><ul><li>Static Registry </li></ul></ul></ul><ul><ul><ul><li>PushRegistry </li></ul></ul></ul>
  14. 14. References <ul><li>ALVES F. Eduardo. SCMAD Study Guide, </li></ul><ul><li>27/04/2008. </li></ul><ul><li>JAKL Andreas, Java Platform, Micro Edition Part </li></ul><ul><li>01 slides, 12/2007. </li></ul><ul><li>Sun Certification Mobile Application Developer </li></ul><ul><li>Website: [http://www.sun.com/training/certification/java/scmad.xml]. </li></ul>

×