Skip navigation
This discussion is archived
12327 Views 19 Replies Latest reply: May 12, 2007 6:18 AM by hamza RSS
Calculating status... 1 posts since
Mar 3, 2007
Currently Being Moderated

Mar 5, 2007 6:35 PM

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!

  • Calculating status... 1 posts since
    Mar 10, 2007
    Currently Being Moderated
    Mar 10, 2007 6:49 PM (in response to Mike)
    Re: Smack API to work with j2me?

    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

  • Calculating status... 10 posts since
    Apr 9, 2007
    Currently Being Moderated
    Apr 10, 2007 3:03 PM (in response to Mike)
    Re: Smack API to work with j2me?

    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.

    • Calculating status... 13 posts since
      Apr 14, 2007
      Currently Being Moderated
      Apr 14, 2007 6:10 AM (in response to jad younan)
      Re: Smack API to work with j2me?

      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:

      http://sourceforge.net/projects/beep/

      • Calculating status... 10 posts since
        Apr 9, 2007
        Currently Being Moderated
        Apr 15, 2007 1:45 PM (in response to hamza)
        Re: Smack API to work with j2me?

        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.

      • Calculating status... 8 posts since
        Apr 25, 2007
        Currently Being Moderated
        Apr 25, 2007 2:56 AM (in response to hamza)
        Re: Smack API to work with j2me?

        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..

        • Calculating status... 13 posts since
          Apr 14, 2007
          Currently Being Moderated
          Apr 25, 2007 9:20 AM (in response to Henrik Östman)
          Re: Smack API to work with j2me?
          • Calculating status... 8 posts since
            Apr 25, 2007
            Currently Being Moderated
            Apr 26, 2007 3:17 AM (in response to hamza)
            Re: Smack API to work with j2me?

            What´s new in this release?

            • Calculating status... 13 posts since
              Apr 14, 2007
              Currently Being Moderated
              Apr 26, 2007 4:08 AM (in response to Henrik Östman)
              Re: Smack API to work with j2me?

              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.

              • Calculating status... 8 posts since
                Apr 25, 2007
                Currently Being Moderated
                Apr 30, 2007 4:04 AM (in response to hamza)
                Re: Smack API to work with j2me?

                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

                • Calculating status... 13 posts since
                  Apr 14, 2007
                  Currently Being Moderated
                  Apr 30, 2007 8:37 AM (in response to Henrik Östman)
                  Re: Smack API to work with j2me?

                  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

  • Calculating status... 3 posts since
    Apr 27, 2007
    Currently Being Moderated
    Apr 30, 2007 1:15 PM (in response to Mike)
    Re: Smack API to work with j2me?

    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

     

    • Calculating status... 16 posts since
      May 1, 2007
      Currently Being Moderated
      May 1, 2007 3:46 PM (in response to sabry)
      Re: Smack API to work with j2me?

      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!

More Like This

  • Retrieving data ...

Bookmarked By (0)