Search code examples
androidhttparduinoandroid-wifi

Arduino - Wifly - Responding to the Http call from Android


I have built an Android App and an Arduino - wifly module. Now the Android app is able to send data to arduino via wifly. As of now I have coded a http params to close the http once after waiting for 2 seconds.

final int TIMEOUT_MILLISEC = 2000;
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_MILLISEC);
HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_MILLISEC);

Could you please guide how to send response from Arduino to the Android app which has established the HHTP connection with Arduino ?


Solution

  • If I understand your question correctly, you want the Arduino board to act as a webserver. There are several tutorials online for that purpose, most notably the one on arduino.cc.

    You should expect to do some more work on the Arduino side to get something useful out of it, though.