WMA support for the mpowerplayer sdk

About

I have put together a version of the cldc.jar for the mpowerplayer sdk (build 898), that has the start of support for the Wireless Messaging API (JSR 120).

The support is rudimentary at the moment, but it is enough my own needs. As of such I have only really tested the receiving of "SMS" messages and have not really tested sending messages properly.

Changes

15th March 2007

As of Build 1127 of mpowerplayer my code has been integerated with the sdk. So you should not need to download this patched version of the cldc.jar. I am keeping it here for reference purposes (as it also contains the source code). This actually happened a while back, but I've only just got around to updating this page...

18th October 2005

Properly implemented "server" connections. i.e. of the form sms://:1234. Coupled with an additional property for setting the local number (SMSNumber) things should now work properly.

Created WMAConsole app for sending emulated SMSs. This uncovered a few bugs in the implementation, mainly to do with sending (rather than receiving SMSs).

Implementation

The extra code added includes the five interfaces as defined in the WMA (JSR 120) in the package "javax.wireless.messaging".

In addition there are three implementation class in the package "com.barteo.cldc.sms".

Due to the way that the connection classes are loaded by mpowerplayer there was no need to alter any existing code.

SMS messages are sent to the emulator via DatagramPackets. The format of these packets mimics that used by Sun's Wireless Toolkit (WTK). A description of the format of these packets can be seen via this entry on my blog. Otherwise it should be possible to use the WMA console from the WTK to send packets to the emulators.

Configuration

There are three values that are currently configurable via properties:

  • com.barteo.cldc.sms.DatagramHost (default "localhost")
  • com.barteo.cldc.sms.DatagramPortIn (default "54321")
  • com.barteo.cldc.sms.DatagramPortOut (default "12345")
  • com.barteo.cldc.sms.SMSNumber (default "+555555")

It should be possible to set these when running the emulator using the -D switch.

WMAConsole

To aid in testing MIDlets that use the WMA I have also created a small GUI program that allows the sending of emulated SMSs as UDP packets. WMAConsole allows you to send packets to the emulator in either text or binary format. To use it compile the source file, place the class file in the same place as the cldc.jar file, then run it using: java -classpath cldc.jar:. WMAConsole

Download