Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Help with web Socket jsp.

JLuna5
New Contributor I
2,120 Views

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?

0 Kudos
14 Replies
JLuna5
New Contributor I
2,120 Views

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?

0 Kudos
Alexander_W_Intel
2,120 Views

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 

0 Kudos
JLuna5
New Contributor I
2,120 Views

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.

0 Kudos
Alexander_W_Intel
2,120 Views

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 

0 Kudos
JLuna5
New Contributor I
2,120 Views

Hi, 

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

Thanks you!

0 Kudos
Ashwin_S_Ashok
Beginner
2,120 Views

so you are trying to do it in java..?

0 Kudos
JLuna5
New Contributor I
2,120 Views

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.

0 Kudos
Alexander_W_Intel
2,120 Views

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 

0 Kudos
JLuna5
New Contributor I
2,120 Views

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!

0 Kudos
Alexander_W_Intel
2,120 Views

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 

0 Kudos
JLuna5
New Contributor I
2,120 Views

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

0 Kudos
Alexander_W_Intel
2,120 Views

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 

0 Kudos
JLuna5
New Contributor I
2,120 Views

Thnank you Alexander for you attention!

0 Kudos
Neeraj_R_
Beginner
2,120 Views

 

  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

0 Kudos
Reply