to develop an internet messenger what should i do? - java

i want to know how can i make some thing like skype or yahoo messenger ?
i mentioned yahoo or skype because really i want the messenger to handle many online users.
i am a java developer, but i don't have any idea for this kind of projects or either for VOIP and networking ?
can i develop some thing like a messenger only with java ?
and what other technologies, frameworks or any thing else i need to handle this project ?
at the end, can i develop it alone ?! or i need a team to start ?!

I guess that what you need most is knowledge about network programming. This is the first step towards your goal: you'll learn how to communicate between two hosts and among several ones in a reasoned way (some link for java net programming here, here and a book here ). Focus your attention on protocols (low level ones) (and maybe cryptography) and try to spot the right one for your needs. You'll have to understand even ifyou want to write your own IM protocol (high level one) or use one of the existing ones (Jabber, MSN, Yahoo, aim, etc)
Secondly, you could have a look at an open source project that tries to implement something similar in order to understand better how to structure your project architecture, client communications and so on. You can start looking at some lib (here is one for java and Jabber, here for Yahoo) around the web too.
Finally you can start design your project and decide if the work to do is more than a single person can bear in a reasonable time and try to convince people work with you. Or you could also join an open source project if you find any.

Why reinvent the wheel. There are many open source software in JAVA available which supports IM, multiple chats, presence as well as voice and video calls.
Skype is based on SIP + its own proprietory technology. So skype will only work with skype. Forget about interoperability
Gtalk uses XMPP (www.xmpp.org) for its chats, but uses libjingle(for RTP sessions) for audio/video calls. (The libjingle protocol and Jingle are very similar, they are not the same, and are not interoperable)
Yahoo, Facebook... there are many IMs which are now moving to XMPP. (Why..??? because of interworking)
So if you want to create your own IMs which interworks with gtalk, yahoo... all the available IMs, use XMPP libraries. To start with you can download JAVA version of XMPP - SMACK. Use its simple APIs and your IM is ready.
So if you really want to do something interesting come up with new features, contibute to open source community, patent your idea/technology or sell it to big guns. :)

You probably want to research on socket. A lot of socket application made by java btw. For simple chat application it is. However video chat or VOIP needs a lot more effort.

Explore java.net
Learn socket programming, ain't that complicated.
About handling multiple clients, you server would have to have multiple threads. One for each client.
Developing a simple chat messenger is not that a bid deal in java. One can do this on its own.
Probably, you can even handle multiple clients with multi-threading.

Related

Lotus notes agents - registering a Agent on a database

I am writing a remote Lotus/Domino NSCO (Notes CORBA API) Java client for reading and writing to a Domino server. The client should roughly be able to act and simulate all the features of Lotus Notes desktop client for a user's mailbox (Mail, Calendar, Tasks).
Those of you experienced with NSCO.jar are probably already aware of many limitations it has. One example is marking a document as read/unread, which isn't implemented with this API. To bypass this, my latest direction is writing a Java Agent on the server side, which would use Java Notes local API to mark a document as read/unread. I can later call this client using the NSCO API. I would like to be able to call this agent for every user (every user has his own database), but I dont like the idea of creating an instance of this agent on each database. According to this, my question is:
- How (if possible) can I register an Agent in Domino so that is available for every user?
Apart from this specific question, I would very much appreciate any links towards good documentation or books on this topic. (I believe I have already browsed through most of online documentation, and it's quite poor or out-of-date so books might be more useful)
Thanks.
Your question is very broad but I will attempt to answer what I can.
First, I don't think you realise the huge task you are attempting to do in simulating the Notes Client.
Much of the functionality in the front end will not be available for you, and creating back end agents to get to that functionality is going to put undue stress on the server. You are going to have to do some serious load testing to see what impact it has.
How (if possible) can I register an Agent in Domino so that is available for every user?
The proper way is to create the agent once in a template and then have the mail files update their design (Admin related help). The agent is then run within each users mail file as they need it. You also need to factor in how the agent runs. For example if you run it scheduled then AMGR may not run it as you expect it to.
If you plan to have one agent you kick off to process all databases, then you start having to deal with security of your agent.
Alternatively you can go the route of DOTS tasklets. These are OSGi bundles which can run like a service on the server.
I would very much appreciate any links towards good documentation or books on this topic.
The help within the Domino Designer client will be the most up to date on the API. The Domino Wiki will have a lot of resource material you are looking for.
Personally I think what you are attempting to achieve with just NCSO is not going to cut it. I would recommend to leverage already existing standards to talk to the server. For example POP3/SMTP/ICAL/RnR/DDS (REST API). Or use iNotes which would have much less overhead then what you are trying to achieve.

Java libgdx(desktop/android) multiplayer game how to

I have a game called wizard wars that I have been working on. This game needs to allow 2 players to play at one time, and would need a TCP connection to communicate spell creation/destruction ect., and a UDP connection to handle locations ect. It would have a client and a host side. That being said my program is designed to run on Android. All of the tutorials/information I have found online has been for JApplets or something like that. So what I would like is some help with ever short code examples of how to set up/use connections, or just a link to some sufficiently helpfull information on how to set up the actual connections.
The best approach (or at least 1 approach) would be to use normal HTTP requests : http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Net.html
You create a webservice implementing REST and create calls for both updating and consuming data.
Alternatively, if you're just going to use Android and Desktop you may also use WebSockets : https://github.com/pepedeab/libGDX-Net
For those who don't read comments, but still looking for tcp client.
You can use KryoNet which supports Desktop and Android
https://github.com/EsotericSoftware/kryonet
Have you guys looked at the multiplayer super jumper tutorial? Its written using AppWarp and is being actively used in the libgdx community as well.

P2P file sharing application

I have developed a simple file sharing application in java using TCP socket. Now, the question is how do i make this application P2P? Can Distributed Hash Table (DHT) do that or there are other options that i can implement in my application to make it P2P? I have been trying to get ideas on this for a long time but i only get more confused. Please help.
The Forest platform which is in early development is targeting applications like your. You might want to take a look at it.
The only problem is that it is still in development and is not yet usable. I advise you to keep an eye on it and try to use it once it reaches it first release.
EDIT to answer the comment under your question:
Your application would need to connect the some peers. Depending on how you choose them (random people or know contacts), you are using respectively a peer-to-peer ('p2p') network or a friend-to-friend ('f2f') network.
Forest is providing applications a f2f network, but application are free to route messages on the top of this network to achieve (anonymous) p2p.
For a classical p2p network, you would need to connect a DHT, and you would need to bootstrap to it via a (or some) server(s) which take part in the DHT.
In general, p2p application are not so simple to do, and you will need to deal with a lot more details here and there. If you really want to experiment with them, you can go to check existing DHT libraries and see how they work. You might first want to go to read the article on Wikipedia about Kademlia which is the base for the most used DHT algorithms.
Based upon your description it sounds like you have already created a simplistic P2P application. If you are looking for the next step I would setup a DHT server (bamboo). Next, modify your original application to get a list of available files from the DHT instead of connecting directly to the other peers for file lists.
I develop a simple P2P file sharing application in java too,but i find it hard . If you write it in java . You can search for Vuze or jBittorrent , which may help you develop it faster.

Multiplayer browser game [Java]

I've been developing a small card game which is called "Tarneeb". The game itself looks like Bridge card game but with different rules. Anyway, i finished the entire game as a standalone desktop application using Java 6. This is a picture of the game. Anyway, i now need to transform that into a web app with multiplayer capabilities, so the users can for an example make a new room and join existing rooms where the game is played.
Unfortunately, I have no idea on networking in Java but i searched quite a lot and i found some other Java products that may help me (JavaFX, JSP, GlassFish) but i still couldn't figure out what i exactly needed to accomplish my task. All i need right now is the direction to head to and i will do my research and hopefully learn the new skills needed.
Other answers have already pointed you to some resources.
But the biggest problem you will likely have is that it is usually impossible (or extremely time consuming up to a complete rewrite) to "add" multiplayer capabilities afterwards if you didn't plan the architecture accordingly.
As you might have a lot of interaction and a lot of updates which I should - correct me if I'm wrong - be at the client as fast as possible, I'd suggest having a look at Cometd which keeps the http connection open to each client and pushes the updates from the server to the client. If you're using jetty as webserver (and thus its "continuations") it's even highly scalable.
The thing is, there isn't one standard way of doing this which you need to read up on.
How do you want to implement this web application? As an applet? Using standard web pages? As a web start application which people have to download?
The last option would allow you to re-use most of your existing code. If you go with that option it may be worth you looking into RMI as that will probably fit in with your existing architecture.
But otherwise, as S.Lott pointed out, you need to go and learn how to make web applications before doing anything else. Those tutorials would be a good start, also you should definitely learn (X)HTML, JavaScript, and a Java web technology such as JSPs, JSF, or Struts. Exactly what you need will depend on your requirements, without more details it's diffiult to recommend one.
First, learn what a "web site" and "web application" are.
Do the tutorials: http://java.sun.com/developer/onlineTraining/index.jsp
Watch the Glassfish Tutorials: http://java.sun.com/javaee/overview/screencasts.jsp
Once you've done all the tutorials, you will have built a web application.
After you've built the tutorial web application, you can build your web application.
Web apps are very badly suited for the kind of realtime interaction you have in a card game. Yes, it can be done, but it will involve dirty hacks and you'll always have problems with high latency and broken connections. And of course you'll have to completely rewrite most of your app.
If there a possibility of running the game as a Java applet? That would make your job much easier (enable much more reuse) and the end result more usable.
There is no way to port a client based app into a web app quickly. Depending on how you want to go about it, it sounds like you either need to pursue a JSP/Javascript solution or a JavaFX solution. JavaFX actually allows for smoother (smoother than JSP/Javascript, but still going to take more than an afternoon =D ) porting of client based apps, but it has a steeper learning curve than JSP/Javascript technology in general. An interesting note here is that JavaFX isn't just a web app language. If you had coded your initial client based app in JavaFX, you would have about 50% of the work done.
JavaFX
Use Java NIO, it is quite simple and if you will grasp the basics, there would be no real need in all these countless libraries... or anyway you would know their internals. One of the important things however, mentioned here already, is that the game structure has to be adapted for networking from the start. It may be a complete rewrite in the worst case. Basically, you will have to create clients database, socket connections, and from the server side, every connection (represented by a SelectorKey object), should be encapsulated into an object, representing a "joined client". Then read/write operations would be performed to the key's socket. But there is more. The server will have to be the center of your application link, so that you will have to develop an entire network messages protocol for your game (over TCP, there is no need in UDP in this kind of game). Also - read more about the protocols (TCP/UDP/sockets, ethernet), the more you read - the better.
Also! Pay attention to the HTML5 websockets stuff. It is a great thing!!!

AIR (Flex) vs Java

I am writing a desktop application and trying to decide between using AIR (FLex) or Java. Some of the requirements for the application are:
needing to securely connect to web
services and JMS
have a very interactive UI (lots of
little and big features)
displaying video
Communicate with a C++ application
To implement the web services and JMS for Flex we were thinking of using Merapi to communicate with a Java application. Does this mean we should probably go with Java or does the better graphics capabilities of Flex still make it a better choice?
Which language would you choose?
I'll try to address each of your points below:
needing to securely connect to web services and JMS
Flex/AIR supports SOAP although it does not support most (any?) of the WS-standards, such as WS-Security. Flex/AIR cannot directly communicate with JMS however you can add the Blaze DS Java component to the backend, which can adapt a JMS endpoint for use with Flex/AIR's Consumer/Producer messaging architecture.
have a very interactive UI (lots of little and big features)
I think overall Flex/AIR wins here. Not that you can't do cool UI's in Java / JavaFX but Flex/AIR will let you build a cool UI with significantly less code / effort.
displaying video
I haven't worked with video much in Java but it's easy to do video in any Flash environment. You probably want to consider which formats you need to support to help steer your decision.
Communicate with a C++ application
AIR 2.0 will allow for direct communication with native processes, so depending on your timeline you might be able to use native AIR functionality instead of Merapi. Java obviously has this capability already.
I'm a partial fan of AIR having done a rather large "flashy" UI on-top of a bunch of XML based REST services. Flex has numerous issues, but it has come a long way. It's performance as of 1.5.x is good and it's garbage collector is finally getting better to.
AIR Points:
Good but not great documentation
Fair amount of libraries
Great video support
Great for snazzy layouts
Good but weird CSS support
Good community
Growing base framework (Adobe is actually pushing it)
AIR framework doesn't have to be installed by Adobe's installer
Pseudo one-click browser based "Badge" installer
Java Points:
Good but not great documentation
Tons of libraries
Decent video support
Okay for layouts (very old-school - even SWT)
Solid community
Framework is relatively stagnant (I don't personally feel Java being pushed. Once corporations latched on Sun stopped growing the language until .NET and other dynamic languages started going after their market-space.)
Java applications almost always require specific JRE versions
Java, much like AIR, requires the JRE but you can't install it yourself (silently).
When you get to choose like this there is never the "right" answer, only the one that makes sense to you and your team. Everyone's got differing opinions and all languages have drawbacks. And no matter what you pick, there will always be a point (if not many) when you double guess yourself.
Good luck!
I think both technologies handle most of your requirements well, but in my opinion, Flash/Flex is the easiest way to deal with video. AIR applications are a little annoying in that they're AIR applications and you can't just install them without the AIR runtime. That said, AIR provides a lot of nice features like installation, auto-updating, etc.
I'm not sure how easy it will be to use JMS with Flex, although if there aren't already AS3 libraries to handle it, I don't think it would be too hard to write one. That would be my biggest concern in using Flex. Otherwise, it does UI and video well.
If you're going to use Merapi to communicate with Java, you have to remember the limitations of AIR. AIR can't start any system processes on its own, so if you want to communicate via Merapi to Java, you need to have the Java process started before your AIR application is started. There isn't really another way around this, yet.
AIR 2.0 will be able to launch processes, but until it's released, we're stuck waiting around.
Personally, I like the way UI is designed in Flex. I'm not sure if Java has something that is equivalent.
I know that Flex/Air can connect to normal web services (and I believe you can wrap something for JMS support as it works over HTTP?).
Not sure about video compatibility though, if that is an issue for you.
I assume performance is not a primary issue.

Categories