Big Brother GPS

Big Brother GPS Write/Read Page by angelone

This PHP script can be used to post Data from BBG to a mysql Database and read it from there.
It resolves the geocoordinates and writes the decoded data back to the database.

bbg-screen

You can download it from here: https://myangelone.com/files/bbg.tar.gz

You can get Big Brother GPS from here: https://play.google.com/store/apps/details?id=org.gnarf.bigbrother.gps

Installation:
The Database has to be created like this:

CREATE TABLE IF NOT EXISTS `gps` (
`timestamp` varchar(15) NOT NULL,
`latitude` varchar(50) NOT NULL,
`longitude` varchar(50) NOT NULL,
`accuracy` varchar(50) NOT NULL,
`provider` varchar(10) NOT NULL,
`altitude` varchar(20) NOT NULL,
`bearing` varchar(20) NOT NULL,
`speed` varchar(20) NOT NULL,
`sattime` varchar(50) NOT NULL,
`battlevel` varchar(5) NOT NULL,
`charging` varchar(5) NOT NULL,
`deviceid` varchar(50) NOT NULL,
`subscriberid` varchar(50) NOT NULL,
`klartext` varchar(200) NOT NULL,
`request` longtext NOT NULL,
PRIMARY KEY (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Then, you have to input the mysql userdata into the variables at the beginning of the script in read.php and write.php
Usually you just have to change the user, password and database variables.

Plain resolving of coordinates to addresses can be done without a Google API key in batches of 10 requests per time.
Just refresh the read page a few times until all records are resolved.
If you want to use more then geocoding, you have to get an Google API key.
How this is done is explained here: https://developers.google.com/maps/documentation/javascript/tutorial?hl=en#api_key
All API methods are included in the GoogleMap.php file.

 

Usage:
For added security you can place the read.php inside a folder with htpasswd auth.
The App justs needs access to the write.php which is a standalone file that can be placed everywhere.
My Folder structure looks like this:

/var/www/write.php
/var/www/gps/.htpasswd
/var/www/gps/.htaccess
/var/www/gps/GoogleMap.php
/var/www/gps/read.php
/var/www/gps/JSMin.php

In the app you enter http://www.yoururl.com/write.php as post URL and tick all boxes, so that all available information gets posted.