Track Your Smartphone in 2D With JavaScript

Imagine what you can do with this new medium of interaction

Sanjeet Chatterjee
Better Programming

Photo by the author.

With a fundamental shift to the web, we are able to do really cool things right from our browser. In this tutorial, we will be utilising the Generic Sensor API to turn your smartphone into a pointer with real-time tracking.

Here’s what we will be making:

Prerequisites

  • As of writing, the Generic Sensor API is not yet supported on iOS. In addition, some Android smartphones don’t have the required sensors. However, it is still possible to work through this tutorial with simulated sensors found in Chrome DevTools:
  • It is also possible to view the console output of Chrome…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in