I want to send sensor data from an Android device to a Apache web server. The sensor is connected to the Android device using the IOIO board and is sampled at an regular interval.
The raw sensor data is approximately 1 byte/second and I'm trying to find an efficient way to send this to the web server which is based on Apache and has support for PHP and ASP (ChiliASP I think).
In order to have a low monthly cost, I would like to use pre-paid mobile subscription and these usually have a fixed maximum data limit (something like 500 MB/month).
Since the sensor should send data 24/7, I would like to keep the required data traffic at a minimum. Even if the amount of data is not very large, I think that the overhead in terms of protocol headers could be an issue. If each sample (1 byte) is sent separately, the overhead/payload ratio will be very poor. On solution is of course to aggregate some data and send it in bigger chunks.
I have successfully tested Java HttpURLConnection to send data using an HTTP POST and have some questions about this:
- How large is the overhead due to HTTP headers? Is there some easy way to measure it?
- Is there some other protocol supported by Android and Apache which I could consider?