I have made an Android application that sends GPS coordinates to a PHP script (every second) which sends them to a database to be stored, and then a Javascript program pulls the coordinates (every second) and displays them on a map and tracks the user with markers and a polyline.
I'm having trouble with the reliability of the app, however. I tested it in my room and I'm able to receive the location updates just fine, but when I was in class today, the phone would not send the coordinates. I walked outside and immediately picked up a signal and my coordinates were sent and then received by the PHP script. Is there anything I can do about this or will I always have issues when inside large buildings? I'm using 2.2.3 if that helps at all.
Another issue I'm having is the time delay between when the button is pressed and when the coordinates are received by the PHP script. It takes about 20-30 seconds before the database records them. I send some other data to a different table and it gets to the db almost instantaneously. Could this be because I have so many programs that the coordinates must go through, or is the time delay to be expected since the phone must run more complex processes to obtain the coordinates? Is there anything I can do to reduce this delay time?
You should debug your code on the client side (app) and on the server-side (php).
Create a unique ID for every update "transaction" and print it on both sides:
* In the app - you can connect the device to the computer and use eclipse and add debug-printings. If you want to be able to get away from the computer - you'll have to print a log file on your android app
* On the server-side you can use microtime() and print the relevant ID with the time the request was received
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With