Just curious what i would need to use to creat a desktop application that could communicate with a server API that uses and returns PHP?? Do i need a third party plug-in, or is there something already built into Java that can do this? any links or tipps woiuld be appreciated!!
Returns php? why would you want to return php from the server?
What I could make out from your query is:
"You need a build a java desktop application which woulc communicate with the server. And this server is implemented in PHP."
So you send the request from the Java desktop application to the server, the server processes it and sends back the response to the desktop application.
Check out the java.net package for classes which support making http requests.
I was reading through an API example from the API i plan to try, and it says "All data is returned in JSON format", i don't know what json is really, is this something i will have to learn in order to do this as well? For that matter i don't know much in the way of PHP either.Will i need more extensive knowledge of PHP/json in order for me to do this?
Joined: Oct 13, 2005
You would be learning PHP if you want to write the server which handles the requests and sends the response.
"Online", and creating a clickable link to the server they are on.and possibly if the user wants to, a button to start the game.exe and go to that server.as well as server info with names of players and how many and so on.
I will take a look at the link from Mohamed!!!
You can use java.net.URL with URLConnection / HttpURLConnection, but perhaps you'd prefer a more high-level abstraction like that of Apache's HttpClient. It can do the same, but it's easier in some aspects (like cookie handling for instance).
Thanks for your reply. hm I am looking a bit through my deitel "How to program eighth edition" for some guidance, it has a networking chapter , but not exactly what i am looking for at the moment.I will take a look at the apache httpclient , then i will have to pick what i will try and just go for it and see what i end up with.I think i will just start off by opening a connection to the API server and get that working and then see if i can communicate with it. Not really sure how to send it anything yet either.I was thinking this will be an easy little program to learn about networking, but i think it involves allot more than i was expecting it too lol.
But it is OK i want to learn about this as i think it is pretty interesting and something that is worthwhile to learn.If anyone has a good tutorial about this type of client/server API program feel free to send me a link;)