Help with web Socket jsp.

Help with web Socket jsp.

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?

JudLup Luna
15 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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?

JudLup Luna

Hi,

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.

JudLup Luna

Hi,

so you mean you want to use HTML5 web sockets on the client side (Android) and Java Server Pages(JSP) on the server side? 

Thanks,
Alex 

Hi, 

Not initially think it will be both client and web server, android not yet.

Thanks you!

JudLup Luna

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.

JudLup Luna

Hi,

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 . 

I think you should also consider to use node.js instead of JSP. It is easier to use especially for html5 projects. There is a nice tutorial here: http://net.tutsplus.com/tutorials/javascript-ajax/real-time-chat-with-nodejs-socket-io-and-expressjs/

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!

JudLup Luna

Hi,

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

Thanks,
Alex 

Hi Alexander,I need to apply to node js mvc.

JudLup Luna

Hi,

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?

Thanks,
Alex 

Thnank you Alexander for you attention!

JudLup Luna

 

  Hi Alexander,

     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

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!