powered by Jive Software

Smack & J2ME (CDC-PP)

I’'ve seen in this forum previous old posts about Smack and J2ME. But they were about CLDC or very old Smack versions.

I’‘m interested in Smack and J2ME but for CDC and PersonalProfile. CDC has less restrictions that CLDC and therefore I think that the effort to have Smack running on a CDC+PP device should be less. I haven’'t done any tests yet but from a quick view (on the packages involved in Smack) I think that the problem will be with SSL and swing.

Do you have any statistic about Smack’'s memory footprint? Do you have plans to support a Smack J2ME (CDC+PP) version?


– Gato


Although we don’‘t package or test Smack against any of the J2ME configurations or profiles, it shouldn’'t be too hard to make a distribution that works on most J2ME setups. As you noted, Smack currently ships with SSL and Swing components. However, the SSL support can easily be removed by deleting the appropriate classes, and Swing is only used for the smack debugger. You can remove it without breaking Smack (in fact, it would be great if you could create a replacement to the swing debugger that logged to J2ME logs).

As far as memory size, smack is a decent J2ME candidate. You can get it smaller and better suited to J2ME by replacing XPP, the XmlPull parser shipping with Smack, with another J2ME specific XPP parser. There are several choices (see http://www.xmlpull.org for compliant parsers).

We don’'t have plans to package or test Smack for J2ME but would welcome help in that area. If anyone in the community wishes to help us get the package together (send patches of the ant build.xml file) and test, we would gladly consider integrating it into the build and distribution of Smack.


With very few modifications, we’‘ve gotten smack to work on the J9 JVM running on an Ipaq 3600. Most of our mods had to do with including stuff that wasn’'t part of the default rt.jar and some stream encoding changes.

As we look at moving it to the palm platform, we expect to have to make some changes to the xml parser and probably the transport layer (we may extend to use the Tcp/ip bluetooth profile).

In practice, once we started using J9 and discovered the correct encoding supported by that JVM, we have had very few problems in getting smack 1.1.1 to run.


That’‘s fantastic. I’‘m very glad to hear it’‘s running on the ipaq. If you think it’‘s something you can help us maintain, we’'d love to provide the patches as an alternate package of Smack for J2ME.


We will be happy to submit some patches to create a ‘‘SmackME’’, but we want to get it a little cleaner and less of a hack before we do so… It works, but is a ugly combination of hacks and changes to the standard ME vm. Once we have it to where it can be deployed on a standard vm we’‘ll contribute…Iain and Matt, if you’‘d like more details, email me and I’‘ll discuss what we feel has to be done before we’‘re comfortable releasing our branch. Another area of interest is that we will be running this on an AS/400 soon as well… I don’'t think that there will be many changes to the library for that environment at all.

Great, just let us know when you feel comfortable with it. If there are details we need to discuss, let me know and we can take it over to email. And we’'d also love to hear how it goes on the AS/400! Wow you guys are up and down the size scale!