my image of mChat is very similar to the Karol one. before all, excuse me for my english!
so, I've working for about 2 months on a J2ME chat application with jabber, and working on the code (a chat is a chat so the requirements are known!) I found some problems:
- a lot of phones (and wap gateway...) have a limit of 30KB, so for me we don't have to exceed this limit, or the application will'be usable for not many devices.
- the implicit mechanism to do chat is socket, but the protol support in the J2ME specification devices is not requested, so when I try to use it in the nokia & siemens dev toolkit, the emulation gives me this exception "the protol does not exist"!!!! wonderful ;-) i'm going to kill me when i see that message. The devices that support socket in j2me are 2/3 motorola and other high costs and new devices. (the mechanism to speak directly with jabber is socket and only socket for me, or not?)
The idea to workaround it, is to do a polling with http connection (not standard and not directly applicable to jabber, we need a proxy component), and send and receive data in syncronous mode, but it's not very elegant... (and we pay money for connection polling also!!!)
- another problem, honestly, is xml jabber parser in a j2me device, the smaller takes 10Kb, and under the scenes there is also a character stream reader handled in a separate thread (it's asynchronous in notification of message), so we have 3 or more thread: the midlet, the xml parser, and the char reader from connection (if it's socket), at this point in a multithreading environemnt, it's very difficult to work and the devices for my experience look very different... this solution it's hard to mantain and fix bugs.
so, what to do?
I take a decision at this point (2 weeks ago), but this is a crucial decision, and I want to know your opinion about this:
I make a proxy application (a simple servlet) that handles the phones, dispatches message to jabber, mantain polling session, count the message sent.
The client speak with jabber message sent to the servlet, they are forwarded by the servlet to jabber, and a http polling is used by the phone to receive the message serialized (serialization is not implemented in j2me, so i do the object serialization with my hands ;-)
Now the midlet (no xml parser, no crash, very fast) work in the same mode on all emulators (25kb) but it doesn't work directly with jabber.
Ah, I've no problem to give the code to sourceforge community, so we have a starting point, but my decision to make a proxy is the right decision? it's a good question...
so, let me know your opinion!
Franz.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
my image of mChat is very similar to the Karol one. before all, excuse me for my english!
so, I've working for about 2 months on a J2ME chat application with jabber, and working on the code (a chat is a chat so the requirements are known!) I found some problems:
- a lot of phones (and wap gateway...) have a limit of 30KB, so for me we don't have to exceed this limit, or the application will'be usable for not many devices.
- the implicit mechanism to do chat is socket, but the protol support in the J2ME specification devices is not requested, so when I try to use it in the nokia & siemens dev toolkit, the emulation gives me this exception "the protol does not exist"!!!! wonderful ;-) i'm going to kill me when i see that message. The devices that support socket in j2me are 2/3 motorola and other high costs and new devices. (the mechanism to speak directly with jabber is socket and only socket for me, or not?)
The idea to workaround it, is to do a polling with http connection (not standard and not directly applicable to jabber, we need a proxy component), and send and receive data in syncronous mode, but it's not very elegant... (and we pay money for connection polling also!!!)
- another problem, honestly, is xml jabber parser in a j2me device, the smaller takes 10Kb, and under the scenes there is also a character stream reader handled in a separate thread (it's asynchronous in notification of message), so we have 3 or more thread: the midlet, the xml parser, and the char reader from connection (if it's socket), at this point in a multithreading environemnt, it's very difficult to work and the devices for my experience look very different... this solution it's hard to mantain and fix bugs.
so, what to do?
I take a decision at this point (2 weeks ago), but this is a crucial decision, and I want to know your opinion about this:
I make a proxy application (a simple servlet) that handles the phones, dispatches message to jabber, mantain polling session, count the message sent.
The client speak with jabber message sent to the servlet, they are forwarded by the servlet to jabber, and a http polling is used by the phone to receive the message serialized (serialization is not implemented in j2me, so i do the object serialization with my hands ;-)
Now the midlet (no xml parser, no crash, very fast) work in the same mode on all emulators (25kb) but it doesn't work directly with jabber.
Ah, I've no problem to give the code to sourceforge community, so we have a starting point, but my decision to make a proxy is the right decision? it's a good question...
so, let me know your opinion!
Franz.