Good day, I'm trying to make a web socket with java, it is as a chat, but I don't find how make this, someone might help me with this?
Buenos días, estoy tratando de hacer un socket web con Java, es como un chat, pero no encuentro cómo hacer esto, alguien podría ayudarme con esto?
your question is a little bit unclear. Do you want to write a pure chat application or more something like a messenger. For a messenger I think using the Google Cloud Messaging for Android(GCM) makes most sense. With GCM it is not required to poll for new messages or hold a TCP connection open all the time. You find more information here: http://developer.android.com/google/gcm/index.html . I don't know if GCM would be also the first choice for a chat application.
For writing a chat application there are nice small examples including source code like that one here: https://code.google.com/p/simple-android-instant-messaging-application/ . There are also very easy to use XMPP libraries available that handles all the networking stuff for you. One example is Smack API: http://www.igniterealtime.org/projects/smack/index.jsp
Hope this helps,Alex
Hi Alexander Weggerle,
Thank you for suggestion, I'm trying to make a web socket with html and jsp, is for work in real time, when you do some on an app, if I have the same app and permissions, I will see this change on app in time real.
so you mean you want to use HTML5 web sockets on the client side (Android) and Java Server Pages(JSP) on the server side?
Not initially think it will be both client and web server, android not yet.
so you are trying to do it in java..?
Hi Ashwin, I have tried make an app that refresh on time real in each user of same app, the changes doing for the other user, like a chat.
just some more suggestions which might help you to write your application.I think I found a very sample using JSP for a chat application: http://ben-bai.blogspot.de/2012/01/jsp-practice-simple-chat.html .
If you want to extend your chat for audio and video you can use WebRTC for your application. There is a really nice GoogleIO Talk about it and here is a getting started guide.
I hope this helps you!Alex
Hi Alexander, thank is very util your information, webRTC is a good option for my app, thank you! and if you know about some as chat rooms how make this with node js, express, socket io and session I will be grateful with you!
do you have any specific problem you are facing at the moment? It's hard to help if I don't know where you are with your development at the moment :-).
Hi Alexander,I need to apply to node js mvc.
I never used a MWC framework with node.js. But this one looks very promising: http://sailsjs.org . It has a nice documentation. Does this help you?
Thnank you Alexander for you attention!
Did JSP having SOCKETS?
Actually i am having a task in my company regarding chat application(one-one, one-two many). It is not company related task to test my effecicency but i am a fresher. so, i opted for Jsp (socket).
If it possible how to build such project. Please help me. Thanks in Advance