I am trying to send gps data to a PHP webservice that will then update a mysql database. I would like to be able to update the database once a second. The phone will be plugged in so battery usage is not a concern. Is once per second reasonable and will I be able to achieve that many updates over an extended period of time?
Also, is there a best way to do this? Any tricks that will enable me to do this would be appreciated. One thing I was thinking of doing was to capture 5 gps data points (I'm assuming that an Android phone can get gps data at a rate of once per second) and then every five seconds sending the bundle of 5 data points to the web service. I will also try just sending single data points every second to see if it will work.
Do either of these methods seem like a good approach? Is there a better way?
I'm currently using the Android Asynchronous Http Client Library written by James Smith and Google Play Services fused location provider.
just like sarath says: use an sqlite database to save the gps data. and then use google volley on client side and a rest service on server side. so when using volley you can use requestqueues. then everytime a request finishes you can start the next one. so you won't need to care about how fast it is or isn't able to update. it will just be as fast as possible. you can test it and count how fast it is and then adjust it to an optimum. actually, like this you dont even need a database... just read the gps data and and send a request, when you get a response, send the next.