Putting it all together

In the next two sections, we will put together what we have done so far. First, we'll begin by sending data to the Google Docs sheet. Then, we will build an Android app to show the data on a map.

Sending measurements

We will use a Python script to access GPS data on the Pi that we'll need to run on system reboot. For this purpose, add the following code at the end of the /etc/rc.local file:

sudo killall gpsd
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
sudo rfcomm connect hci0 00:1D:A5:15:A0:DC &
sleep 1m
current_time=$(date "+%Y.%m.%d-%H.%M.%S")
file_name=/home/pi/log_sender.txt
new_filename=$file_name.$current_time
sudo /home/pi/pyobd-pi/sender.py > $new_filename 2>&1 &

Here, we can restart the GPS services, connect to the ...

Get Raspberry Pi Android Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.