0

I have developed fleet management using PHP. Here i plan to track vehicle in real-time and store the locations in my database.

My question is: Possible to track location via android mobile gps using Google API?

If it is possible please give me a way to create this.

Thanks in advance...!

Ramesh S
  • 841
  • 3
  • 15
  • 35

1 Answers1

1

PHP, which is a server-side language, can't query the device's location, instead the client application should get GPS location coordinates via Android's API and send it to the PHP server (for example via a POST request), then the server can handle the data and store it into the database.

GrowingBrick
  • 731
  • 4
  • 12
  • Thanks for reply GrowingBrick you are right. My question is how to get GPS location please give me an example..! – Ramesh S Mar 09 '18 at 12:18
  • Stackoverflow is full of examples for this, just search "android get GPS location", one of them could be: https://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android – GrowingBrick Mar 09 '18 at 12:37