Developers can make use of the accelerometer sensor and continual updates provided by it for many things including motion-detection games as well as updating the position of an object on the screen.
We will use the device's accelerometer sensor on continual update to move an element around the screen as a response to device movement. This is achieved through the following steps:
headtag to import the required library.
bodytag create two
divelements. Set the first with the
idattribute equal to dot. This will be the element we move around the screen of the device. ...