Reputation: 21
The title almost says it all.
I'm building an Android App to collect data on sites. The data is stored in a sqlite database on the unit.
I'd like to transmit them to a web server over wifi. The data is to be stored in sql form and analysed on the web server, then graphed on a web page.
I though about making a csv and send it to a php page that would parse it and write it to the server sql database. I saw alson json, but must read more about it.
What are the best options to have the data transfered with integrity ?
Thanks a lot
Upvotes: 2
Views: 672
Reputation: 505
As an additional option you can use Google's protocol buffers. With protobuf you have to include an additional library and write your data in a specific message format, but you gain an automatically generated library with getter/setter methods and the data is sent in binary form. All you have to do on either end is send/receive the number of bytes of the message and then write/read the message itself; the library takes care of populating all of your instance variables.
Of course this depends on what language you are using on the server, as you have to use a protobuf library there as well; but it would appear that there are many different language bindings, including for PHP.
Upvotes: 0
Reputation: 42834
I would recommend using JSON for a couple reasons:
JSONObject
/JSONArray
classes that are a part of Android that are easy to use.Upvotes: 1