My problem is, i keep track of users location per second, and it makes 60 values in an array in a minute. I wrote a simple php in my server to save the data to a mysql table.
Because of the nature of the connection (as far as i know) , i can save a record per one request with simple httppost object on android side.(request is like : xxx.com/writelocation.php?lat=33.76&lon=45.0&alt=12000)
I tried to solve this by using asynctask but it didnt work. Connection is slow and data is heavy.It takes more than a second for the connection to complete and at every second a new record comes.I am looking for a way to send multiple values at once, at every minute or so.So far, i couldn’t find a solution other than using direct access to a remote database.
But my hosting does not provide remote access to my mysql database.
I need a clever and cheap solution for my problem 🙂 what do you suggest? is using remote database(by database hosting)only solution?
Thanks in advance.
Json encoding is very fast and the bandwish consuming is really small. I suggest to yo to use json to send those data and then to parse the json on the server side and insert the data in the database.
To understand more abou json in android, see http://www.vogella.com/articles/AndroidJSON/article.html
What do you think about ?