implementing a AJAX chat site - java

I want to implement a chat site with following features:
Direct one-on-one chat with a randomly picked stranger
If my conversation partner gets disconnected, I should be shifted to different stranger
In short, I want to imitate http://omegle.com/
Which language is best suited to this task? Jsp and Java? PHP? ASP? Others?
Should all of the messages go through the web server, or is there a better approach?

You may want to look into Google Web Toolkit (GWT). Ryan Dewsbury's book "Google Web Toolkit Applications" actually runs you through the process of writing a basic chat application.
GWT lets you write Java code that is compiled into Javascript for AJAX applications.

I wrote an AJAX Chat tutorial years ago at:
http://www.dynamicajax.com/fr/AJAX_Driven_Web_Chat-271_290_291.html
I also did a JSON version of it too:
http://www.dynamicajax.com/fr/JSON_AJAX_Web_Chat-271_290_324.html
Those are written in PHP but the back end is really simple so you can port it to whatever language you want easily. Here's a version that I converted to ASP.NET
http://www.dynamicajax.com/fr/AJAX_Web_Chat_ASP_NET-271_290_328.html
It works pretty much like Omegle, all you need to do is setup the code to randomly select a stranger.

I recently created a chat script using PHP + AJAX. Yes, all of my chat messages went through the server because it used AJAX and server-side PHP scripting to deliver the messages to the recipient(s).
For an example of a PHP chat script, see:
http://www.phpfreechat.net/

Related

event java google app engine

I just started using google app engine to develop a web application and I'm a little lost on how to deal with events sent from buttons properly.
For some reason, when I try to use a JButton on my application I get this error.
"javax.swing.JButton is not supported by Google App Engine's Java runtime environment"
the only way I managed to get an on_click event so far was to use an html button and use a "post" or "get" requests.
So, is their a tutorial somewhere to help me understand better how to use buttons and other components in my application?
I think you have a deep misunderstanding of what Google AppEngine does. You deploy your code to AppEngine, and it runs on Google's servers. It generally interacts with users in the form of HTTP requests. A user enters a URL, and the Java code might send back some HTML and javascript.
A JButton is a Java Swing component, which is used when developing Java software to run on an end user's machine. Your AppEngine app is not going to run on an end user's machine. You are seeing that error message, because GAE has a whitelist of allowed classes from the JRE.
https://developers.google.com/appengine/docs/java/jrewhitelist
It's possible you may be thinking of Google Web Toolkit(GWT). GWT allows you to write the client/server of a web application in Java, and then cross-compile the client into javascript. This is separate from AppEngine. Although you can develop a GWT application, and deploy it on AppEngine.

Create a Firefox plugin that interacts with our java application

I have a java application that i made which stores the contacts to a web server and connects through apis to import send mail and so on.
I was thinking if there was any easy way to call my classes from a firefox plugin and send email etc.
I dont want to go very deep if that is alot of trouble i currently know Java, C, JavaScript, PHP.
I never used it, but there's information on MDN on calling java code from a firefox-addon.
See it here : Java in Firefox Extensions

How to mimic Facebook's "Like" feature in WebSocket

I developed a proof of concept application that uses WebSocket to mimic the functionality of Facebook.
If on Facebook someone "likes" a picture, I see the notification on my page right away without me refreshing the page. Is this being done by WebSocket? What strategy is this adopting - pub/sub?
The application I developed is in Java and I came across Atmosphere Framework. I'm not sure which sample I should review from their vast list of examples on GitHub to accomplish what I'm trying to do.
Without Facebook API, we'll have to find a certain way:
On a dedicated server, since you are not using Facebook API, I would use an auto refresher that refreshes the Facebook page every interval of time and put the number of likes in a database.
Then, use AJAX on your website that communicates with a PHP file on server.

Easiest way to establish data communication from Android to a Eclipse program with WLAN

Now, I have some problems here:
I looked several times in Google and so on, but I can't find an "easy" way to get this done. And currently having a migraine... not helping me... though
I have a java eclipse program (Swing application to be a "controller" for production-machines).
I need to design an Android app, which needs to take data from the eclipse program in a wireless network (and also send them back).
Just found solutions like JPARSON or setting up a real server, but that is way too complicated... i donĀ“t need?! (or want :D ) to set up a whole website with php or something...
Can someone of you help me out with a better solution? It doesn't need to be code-specific, I just want to exchange like 10 strings for these machines.
If you want to exchange data you need a communication medium. The easiest way to do this is via TCP/IP protocol suite. If you decide on having a Server-Client architecture, your serwer has to listen for what phones have to say. He can do this by listening on specified port and you would have to handle "protocol", or you can use somewhat easier approach which is to write php script, or Java Servlet. PHP script is easier becaouse there is like a gazzilion php hosting providers and it's cheap. If you would like to write your own serwer, you wold need some sort of Virtual Private Server, and deploy your app there. Plus it would be helpfull if you explained a little more your environment and what you are trying to achive.
There's built in httpserver http://docs.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/index.html so you can easily implement a simple webservice in standalone java. Then just use URLConnection from android to post/get data, probably in json or your own format.

iPhone - java networking service?

I am looking for some kind of tutorial which will help me make an application which would connect to the server on the computer and would respond as soon as the app is launched like would print out Hello World or something. I know one of doing this is bonjour programming but I am not really sure how I would connect to a server made in Java..So I am looking for some kind tutorial which would let me achieve this or if possible you could help me give a kick start....
thanks,
TC
This is from another discussion similar to yours. It might be able to help you
How can I connect iPhone and web service and get XML data?
If your server returns XML and your iPhone app parses it and creates/populates views based on it then it should not matter what language your server is using,

Categories

Resources