I am not sure I have chosen the right way to do it.
Assume the user has a data plan, his personal "hotspot", on the smartphone.
For example if I use .PHP to _POST data every 30 seconds on the server, and use java.net.URL and java.net.Connection on the Android end, whether it would be better to keep the connection alive on Android and keep the loop running until the user shuts down the app OR re-connect in however many seconds.
On the server side, it executes a .PHP, grabs the values from the URL and insert them into the database.
Since we are using 4G LTE, and we have only 4 to 5 variables in the URL-string, it shouldn't be a problem (P.S. I am using T-Mobile).
But what if the user does not have a data plan or has just exhausted his 7GB data plan? Than he would rely on the relatively slow 4G LTE.
Also keeping the connection open might be an issue in a production environment with a heavy traffic, especially since the user is driving.
I am assuming the user plugs his smartphone into the charger in the car. The battery wouldn't last 2 hours.
Any thoughts and practical experience you might want to share?
Assume the user has a data plan, his personal "hotspot", on the smartphone.
For example if I use .PHP to _POST data every 30 seconds on the server, and use java.net.URL and java.net.Connection on the Android end, whether it would be better to keep the connection alive on Android and keep the loop running until the user shuts down the app OR re-connect in however many seconds.
On the server side, it executes a .PHP, grabs the values from the URL and insert them into the database.
Since we are using 4G LTE, and we have only 4 to 5 variables in the URL-string, it shouldn't be a problem (P.S. I am using T-Mobile).
But what if the user does not have a data plan or has just exhausted his 7GB data plan? Than he would rely on the relatively slow 4G LTE.
Also keeping the connection open might be an issue in a production environment with a heavy traffic, especially since the user is driving.
I am assuming the user plugs his smartphone into the charger in the car. The battery wouldn't last 2 hours.
Any thoughts and practical experience you might want to share?