Light Sensor Plug-in

//Light Sensor Plug-in

Plug-in Overview

This plug-in enables your app to detect the ambient light level of the device. The plug-in provides automatic events for normalized lux value changes of more that 5%. You can also query the plug-in for the current light level at any time.

  • Plug-in ID: org.ambientdynamix.contextplugins.photodetector

Supported Context Types

Context Type Privacy Risk Level Data Types Description
<PLUGID>.luxvalue LOW IPhotodetectorContextInfo Provides the ambient light level in lux.
Descriptions of the data types above can be found in the JavaDocs at the end of this page.

Web App Usage

Integrate Dynamix into your Web app, as described here.

Add context support as follows:

Your app will automatically receive an event whenever the device’s light level changes more than 5%. You can also query for the current light level at any time using the following code:

See the JavaDocs below for details on the available context event data. Context events can be handled like this in your Web app’s dynamix_listener.js file:

Native App Usage

Integrate Dynamix into your native app, as described here.

Add context support as follows:

Your app will automatically receive an event whenever the device’s battery level changes. You can also query for the current battery level at any time using the following code:
[DataType JAR Download data-type-download=””]

Context events can be handled like this:

[Context Info Blurb context-info-blurb=””]
By | 2017-09-29T23:39:00+00:00 November 15th, 2012|Plugins|Comments Off on Light Sensor Plug-in