I have created an android application for sending messages to a server for interpretation before the server returns an appropriate answer. I am really trying to demonstrate wireless connections.
So from the Android phone I simply want to send the message, what would be the appropriate way.... httppost? (I have done this with sockets using buffer/print)
In the server class should I use httpget to recieve the message?
Then having digested the message and decided on an appropriate result how would I send it back to the android application? httppost again?
From the android app to read it would I need to once again use httpget?
Examples would really be appreciated. Please bare in mind I am looking to use the http protocol!
Kind regards
Simon
HTTP POST is appropriate in both cases. You can use java.net.HttpURLConnection to perform the POST.
Here is a good example: http://www.rgagnon.com/javadetails/java-0084.html linked to by this answer: Java: how to use UrlConnection to post request with authorization?
I've had good results using HttpClient.
(Didn't run this and omitted try/catches but it should get you started).