Cordova Accelerometer

Make Apps That Access Native Device Functionality. With the Apache Cordova platform you can create mobile apps that access native device functionality such as accelerometer, compass, and other sensors, file system, networking, and so on. This app demonstrates the structure of a basic Cordova app and how to read the accelerometer and display a native confirm dialog.

Source code

You can browse the source code for this example at the Evothings GitHub repository

The file index.html is the main file of the app and contains HTML and JavaScript code.

What you need

This example runs in Evothings Viewer on Android or iOS.

You need to run this example in Evothings Viewer. Alternatively, you can build a Cordova application if you wish to distribute the app. Read more in the documentation of the Evothings Viewer.

How to get up and running

Follow these steps to get started with this example:

  • Run Evothings Workbench on your desktop/laptop computer.
  • Run Evothings Viewer on an Android mobile device and connect to the Workbench.
  • Launch the example "Cordova Accelerometer" from the Workbench window.
  • Try out the buttons in the app and the compass heading sensor.
  • For instructions on how to build a stand-alone native app, check out the Cordova build guide.