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.
While the possibilities seemed endless, I decided to test things by building a prototype backend service for receiving location signals sent from the app itself. What I came up with isn’t nearly as robust as something like Android Device Manager or services like Google+ location sharing, but it allowed 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