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,
Related
I want to create a java server application which receives data from an Android client and also transmit notification to client. Actually i did not know much about server apps. I am quite familiar with servlets and mysql, is there any tutorials based on these??
So any suggestion how to build it or any tutorials for it?? please help me!
What you are probably looking for is Google App Engine a SaaS by Google. While there are many alternatives this is probably the best route you can take for implementing a Java based backend. Follow these tutorials* and you'll be good to go. Keep in mind the GAE is a bit complicated and will take some time to get on your feet.
https://cloud.google.com/appengine/docs/java
More tutorials on GAE can be found by a nice google search!
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.
I want to make a multiplayer Android game and am an absolute novice at anything and everything networking. I have some knowledge of socket programming in C and Java, however from what I understand, it is not that simple when communicating from an Android device to a remote server. Basically, I am just unsure of how to go about setting up server-side components of this project. I've been told to look into frameworks, but am not really sure exactly how they would be used in my particular case.
Here is a breakdown of how my application works and how I want it to communicate to the server. The client application will send a request to the server whenever a user wants to login, create game, make a move, check statistics, etc. The server will update or retrieve information from a database(somehow) and send it to the client. If the player is to make a move, the server is responsible for doing all calculations, storing the gamestate, and pushing the updated game to both players.
I was hoping somebody could shed some light on how I would go about starting this. Any information would be greatly appreciated. Thanks
Essentially you want to set up a Socket Server program listening on your server for connections from the client. You can achieve this through any number of ways, but it seems like you are going to want to tap into a database (such as MySQL) running server side in order to handle authentication of users logging in, etc. Since you say you have familiarity with Java already, and Android is Java based, I would suggest you go with Java for the server application. A few things to look into to get started would be:
Socket Programming in Java:
http://docs.oracle.com/javase/tutorial/networking/sockets/index.html
Chat Client/Server Examples in Java here:
http://pirate.shu.edu/~wachsmut/Teaching/CSAS2214/Virtual/Lectures/chat-client-server.html
Also look into Java JDBC tutorials on Oracle's website (for interfacing Java with a MySQL server), and you will likely find that Android AsyncTask class will come in handy when you implement your Android client. It might be better to start with a pure Java client to get the server aspect working first and then move to an Android-based client. Once you establish some code you can make more refined posts here and gather more specific answers. Hope that helps and good luck.
i am developing a project in which the client and server should communicate asynchronously after ensuring the security.i made all the coding that is required to authenticate a client now it's the turn for communication. My mind is blank can anyone suggest me how to develop it... another thing is server is in j2se and client in j2me..
plz guys my project is based upon your responses help me
See this discussion on nokia forum and existing discussion on same in this forum. Here also discussed on same topic. It may be useful for you. :)
Find an implementation of XMPP and have most of your work done for you...
I have an application that was written in Java and runs on the users machine. I now want to build an application on the iPhone which will communicate with my java app.
Can somebody point me in the right direction on how I can send and receive TCP packets with the iPhone, I want to of course be able to do that using wifi and 3G.
Thanks,
You use the NSStream classes. I've found it pretty easy to use.
See the SimpleNetworkStreams for an example.
One problem I found is that the iphone sdk does not include the NSStream method getStreamsToHost:port:inputStream:outputStream: which is what Mac OS examples use to open a NStream connection but there are lots of places that show you how to create your own like here.