You need a self-hosted web server on which you're allowed to install this kind of script which records GPS coordinates (latitude, longitude) : https://github.com/herverenault/Self-Hosted-GPS-Tracker/blob/master/server-side/gps.php
Then, do what you want with those coordinates. It's *your* data.
For example, you can put these PHP scripts on your server in order to show your family or friend where you are on a Google map : https://github.com/herverenault/Self-Hosted-GPS-Tracker/tree/master/server-side
It may be useful, for instance, if you're alone doing sport in an isolated area : in case of emergency (injury or failure), your family may locate you easily on the map. Provided you have GPS signal and data connectivity (4G, H+, 3G, EDGE...).
This app is NOT meant to be a stealth tracker, or to be forced upon a user. So, please don't ask me how to hide it from the user, or how to prevent the user from closing the app.
I put a demo on http://herverenault.fr/self-hosted-gps-tracker/demo/i-am-here
To see your position on this page, enter http://herverenault.fr/gps in the app on your phone (or tablet). It's an anonymous URL, so if you're not the only one doing it, you may see the location of another anonymous user.
Side-note: There are plenty of apps which do the same, for example Open GPS Tracker. But I wanted an app
* which sends my position to my server, and only my server
* which does not download any map on my phone and thus does not go over my 3G plan
* the most simple ever : just enter URL, enable 3G and GPS and go !
And then, I wanted to do it just for fun. If you're interested in it, source code in available on https://github.com/herverenault/Self-Hosted-GPS-Tracker under Free Software license GPL v3.
This is not a product, I don't sell it, there's no ad. It's only code sharing. Enjoy.