Smack API to work with j2me?

High, Im a college student and I was asked to make a simple jabber client for a phone! The phone will be using j2ME and i was wondering if the SMACK API can work with it?

I got smack to work in java thanks to the great documentation but am having problems trying to get the API to work in j2me.

Thanks for any help you can give me, and if I haven’'t provided enough information just tell me what I should find out!

Interestingly enough I’‘m in a group too that is doing a very similar project. ANY how, it looks like we’'re going to have to port the API to Java ME (J2ME) ourself.

If you haven’‘t worked in Java ME before, you’‘ll soon discover it’'s missing a lot of the flare of Java SE, things like floating point numbers are a luxury not extended to the ME programmer, nor are a lot of the java.util and other basic packages.

It is for these reasons that you can’'t get the SMACK API working (well, probably anyway, based on your description).

I think the trick will be to write a mock up of the app in SE using the API that’'s here, then have a look at your code and figure out which classes from the API you really need, and then implement those classes yourself.

Since this is OpenSource, that proccess should be relatively simple. just copy the code into your ME development environment (I strongly recommend eclipse with the eclipseME plugin - see Link: http://groups.uninotes.org/JavaME_IDE_setup.php). and get rid of all your errors by replacing any code that is unacceptable for ME with your own code. (You may find that it is necessary to write some of the java.util classes yourself.)

…well, … I hope that was of some help.

Barry

Is there an official project set up for this? I have a mobile J2ME application in need of an XMPP client library and might be able to help. Or is there a different Open Source project which already does this well?

hi,

i’'m also intersted into a j2me port of smack.

has anyone done this yet?

lg philipp

Hey guys,

A very very long time ago the same question was made. I remember that it was possible to make the migration and the user that made the migration posted the stesp to follow. Since then we moved to Java 5 so I’'m no longer sure how things would fit now.

Regards,

– Gato

hello guys, i had the same problem using xmpp under j2me, and i used a gmail open source application for j2me to connect to the xmpp running on the desktop, certainly this is not a clean solution, but it works, i have the source code ready, is someone is interested.

Hi Guys,

We already did that as a senior project at the American University in Cairo. it is porting jabber protocol to mobile devices using j2me. here is the link for more info:

Thank u akhi … walla u helped me a lot with this project… walla el shabeb f l university if cairo are doing a good work.

Hi and nice work!

But why the GPL license? Smack is released under Apache, could’'nt you have released it under LGPL?

Now i still have to port smack to JavaME if i’'m to use it in a commercial product…

The new release is now available on https://sourceforge.net/project/showfiles.php?group_id=183541

What´s new in this release?

it contains Bluetooth and Wi-Fi implementation. you can use your bluetooth supported mobile to login to jabber server. for wi-fi you can use the supplied c# application that searches for the nearest wireless post and registers you on and you will be logged in to jabber server too. more information is available on the link posted before.

Hi!

What functions is missing in Beep from the standard Smack API?

And based on experience, could Beep be stripped down even more but still be able to send and receive messages? Can Beep be used to work over HTTP, or has it already support for this?

I’'m about to build a MIDP client that can send and receive messages, and fetch and show a buddylist(rooster).

That’'s basically the only functionallity i need. The client is to be incorporated in a already existing program suit, so size is vital. The rest of the programs is communicating over HTTPS and the kXML parser is already in the suit.

So i guess i need to cut out the kXML parser and Bouncy Castle support from Beep, but is there anything more that could be done to reduce size?

Have anyone had any experience with other Smack API Java ME implementations? Like mobber, microJabber?

How do they compare to Beep?

Sorry for all these questions, but it’'s faster to learn from the pros…

And thanks for all answers!

// Henrik

Hi

well for beep it has some missing functionalities that are found in Smack. we tried hard to reduce the code size to reach that size (85 K i think is good for protocol like jabber).

“Can Beep be used to work over HTTP, or has it already support for this?”

yes it can. Beep supports that.

I’'m about to build a MIDP client that can send and receive messages, and fetch and show a buddylist(rooster).

That’'s basically the only functionallity i need. The client is to be incorporated in a already existing program suit, so size is vital. The rest of the programs is communicating over HTTPS and the kXML parser is already in the suit.

yes this can be done so easily using Beep

+So i guess i need to cut out the kXML parser and Bouncy Castle support from Beep, but is there anything more that could be done to reduce size?

*Well if you removed the kXML then u need to support your parser. but Bouncy Castle is used for cryptography which is too small and simple.

for more info you can see the java docs for beep on:

http://downloads.sourceforge.net/beep/Beep-Beta-Javadoc.rar?modtime=1177629357&b ig_mirror=0

for the difference between beep and mobber :

** beep** is a wireless framework not just an application like mobber, that allow developers to develop their own applications. also, beep supports any kind of communication technology such as WiFi and Bluetooth and any other technology can be easily added to it because of the ease of extending the design. beep doesn’'t depend on the connection established on the mobile device. for example, if the mobile device is not connected to the WiFi post beep will search for the Access points and connect to the strongest signal. However, mobber depends on the existing connection on the mobile and cannot access it. for more details look to the java docs link that hamzawey provided.

any further questions are welcome

best regards,

Sabry

Thanks for all the information!

I’‘ll go with Beep i guess, even if it’‘s little too big for my need. Including all to other software that should go into the jar-file it will be in the order of 500KB, which is pretty close to the maximum limit from many mobilephones. Mobber is much smaler, 26KB, but as you say it’‘s very limited to functionallity. I’‘ll try to get a client going using Beep, then i’'ll try to cut things down as much as possible to save space.

Since i’'m only intend to use HTTP(S) i could cut out the new bluetooth and wireless support, right?

I’'m having trubble to run the Beep-Talk client, it complains about a Nullpointer exception in the bluetooth module, so it would be nice if i could get rid of it. Maybe i should try the older version which did not contain these new functionalities, or was there any impportant fixes added to this new version? I have not browsed the code so closely yet, but do one need Bouncy Castle support even if one send all stuff over HTTPS?

Tomorrow i’'ll look closer at Beep and the Javadocs, maybe all the answers is there… =)

Thanks anyway!

well for the null pointer exception. i think the problem is that you are not running the blutooth server and it is called BlueServer.

thanks

sure if u don’‘t want the functionalities in the c# for the WIFI and the bluetooth part u can can use beep alpha which doesn’'t use them.

best regards

As Beep does’‘nt have HTTP support yet, I have to try to port the Smack support to Beep. But the Smack API codebase is freaking HUGE, could anyone point me to the classes involving the HTTP-support? I’'ve been told that Smack support the BOSH-protocol that make the HTTP connections more efficient, where does those classes live and do I need BOSH to talk to a Openfire-server or is it optional? What pros and cons would I get if I leave out support for BOSH?

Thanks you very much!

Hi,

The new version of beep is available now on :

http://sourceforge.net/projects/beep

the new release now supports roaming and more features.

thanks