After finding Tasker for Android and realizing all of the potential it has, I had to try it out. To begin, I decided to build a prototype backend service for receiving the location signals sent from the app itself. The possibilities seemed endless. As the website states:
Tasker is an application for Android which performs tasks (sets of actions) based on contexts (application, time, date, location, event, gesture) in user-defined profiles or in clickable or timer home screen widgets.
What I came up with isn’t nearly as robust as something like Android Device Manager or services like Google+ location sharing, but it did allow me to think through the ins and outs of implementing products like these. The project requires:
- A web server that can run PHP 5.4 code
- A terminal that can run PHP CLI 5.4 code
git clone https://github.com/kherrick/tracking cd tracking/ bin/build.sh
If everything is in place properly when Tasker posts to the service, the data can be stored in an sqlite database or a simple log file.
The final piece is to generate the output from the data stored. When
tracker.php is executed on the command line, the help page is displayed showing the available arguments.
$ ./tracker.php Tracker version .001 Usage: [options] command [arguments] Options: --help -h Display this help message. --quiet -q Do not output any message. --verbose -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug --version -V Display this application version. --ansi Force ANSI output. --no-ansi Disable ANSI output. --no-interaction -n Do not ask any interactive question. Available commands: help Displays help for a command list Lists commands map Generate a Google static map URL.
$ ./tracker.php map -l logs/YYYY-MM-DD_post_capture_DOT_log Processing... http://maps.googleapis.com/maps/api/staticmap?size=640x640&;zoom=4&;sensor=false&;markers=32.2000000,-64.4500000|18.5000000,-66.9000000|25.4800000,-80.1800000|32.2000000,-64.4500000