Follow Me

Summary

"Follow Me" is a combination of an Android APK (FollowMe-1.8.170.apk), web services, a web application and a number of external services that log locations (part of journeys) per Android device and map this on the web

The option to alert an ICE contact via WhatsApp, Email or TXT with a link to your live location is planned

Android APK

Android Application Screenshot

The APK is responsible for

  • initiatially sending the device's IMEI to the webservice in exchange for a GUID which is stored in preferences and used thereafter to exchange data with the backend.
  • basic session management and
  • toggling the live view in the webview
  • sending a marker along with the next location update that can be used as a reminder of an event on the journey afterward
  • Some functions are accessed via a menu
    • setting "home" coordinates that are moved randomly by a few 100 meters and stored in SharedPreferences. When within 0.5km of those coordindates the device's location is not logged
    • will open the web application
    • will set the contact that your location can be shared with
    • this page

Permissions

The AndroidManifest.xml requires these permissions:

  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.READ_CONTACTS" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

When READ_PHONE_STATE is requested the text used appears give the impression that it might make phones calls. This permission is only necesary to read the IMEI number that is used (in exchange for a GUID) to initially uniquely identify the device. No code to make calls exists.

Persistance

The app will attempt to save new GPS co-ordindates if it's unable to reach the backend in memory and flush them when a connection is available.

External Services

  • virtualearth.net is called to get a descriptive location from co-ordinates for the start and end of a journey
  • timezonedb.com is called to get the timezone / offset from co-ordindates to adjust times into local view

Web Services

Web Services are at single URI served by a LAMP stack that uses Request-Method and the Content-Types header to route requests that

  • Receive a PUT with the device'a IMEI in JSON and returns a GUID (also via JSON) that the APK stores in SharedPreferences
  • Receive a POST each the time application starts (or closes) to close off any open sessions
  • Receive a regular POST whilst the application is active with GPS data in JSON format

Request errors are returned as text/html with an appropriate http code and textual decription that is displayed by the APK to the end user

Whilst it's quite possible to download the APK and use the system without any registration or contact, if you have a need to feed the data into your OWN data store please contact me, it would not be impossible to re-create the data structure and PHP programs and to re-compile the APK with the appropriate URI

Web Application

Web Application Screenshot

The web application is a client server architecture, with Apache and PHP responsible for backend processing and some once off pre-processing of data (discovering dwell points) and Javascript for further processing data on the frontend.

The UI is the responsibility of jQuery, Bootstrap and most significantly Bing maps using jQplot for graphs. Libraries are delivered via CDNs.

The Web application is launched from the Android application, passing the GUID for identification. The GUID is key to identification and, whilst visible on the device, should not be shared. All interactions are encrypted. If a compromise is suspected a new GUID can be generated and data re-assigned to it.

Live view

Continually refreshes, re-centerng to the newest location each time.

Historic track

The historic view of tracks is plotted on a map and a JQPlot graph of altitude and position is super-imposed.

Animated View

I wrote this to animate an historic journey that can be screen captured and used as part of a video production.

Other / Monitoring Services

A service runs every 2 minutes to see if a "significant" change in accelerometer data has occured to notify the device owner (this only works if I know you're using the application) - I need contact details and the IMEI number

This allows me to leave a old mobile phone (GS5) in a car with the comfort that I'll know if it's bumped or there is a break in attempt.

Change History / Challenges

version 0 was started in mid December 2019

knowledge of Scalable Vector Graphics (SVG) and how to include them into the css. Extensive knowledge of Android Java including inter-thread communication.

1.0.x to 1.1.x (early Jan 2020) REST Services restructured

1.1.x to 1.2.x (mid Jan 2020) Location updates changed to using an Android Service

public class LocationCheckService extends Service {

WebApp (late Jan 2020) SVG graphics introduced to PushPins on maps that were coloured and rotated to direction of travel

1.2.x to 1.3.x (late Jan 2020) layout changes and gestures incorporated

1.3.x to 1.3.x (late Apr 2020) animation of journeys for screen recording was added using animated SVG images on a Bing Map

1.3.x to 1.4.x (Dec 2020) Android 10 (Android Q) changes to account for loss of access to IMEI and requirements for Manifest.permission.ACCESS_BACKGROUND_LOCATION & Manifest.permission.ACTIVITY_RECOGNITION

1.7.x (July 2022) Finalised the use of accelerometer data to detect if the phone was bumped so that it could be used to detect a break in attempt (or parking lot accident) and notify me

1.8.x (December 2022) configurable update interval with gesture control and corrected GPS location appearing stale when device not moving


Valid XHTML 1.1 Strict
last updated: 2024-03-11 19:02:43 UTC