Handle operation on system sensor.

Usage

system keyword is needed to instanciate this sting.

var system = require('system');

Data accessors

Methods

Events

Full Example

var system = require('system');
var recorder = require('recorder');

var dataResult = system.data();


recorder.save({
    'foreground' : system.foreground(),
    'LOCKED Lock' : system.isLock(system.LOCKED),
    'ON Screen' : system.isScreen(system.ON),
    'services' : system.services(),
    'timestamp' : system.timestamp(),
    'json' : system.data()
});

system.onScreenUnlocked(function(data) {
    recorder.save(data);
    recorder.sync();
});

system.onScreenStateChanged(function(data) {
    recorder.save(data);
    recorder.sync();
});

system.onForegroundAppChanged(function(data) {
    recorder.save(data);
    recorder.sync();
});

foreground

Retrieve the Name of the foreground application.

foreground();

Parameters

  • None.

Return

  • foreground : String, Name of the foreground application

isLock

Test the current lock value against the given one.

isLock(value);

Parameters

Return

  • Boolean

isScreen

Test the current screen value against the given one.

isScreen(value);

Parameters

Return

  • Boolean

lock

Retrieve the Current locking state of the screen, NOT_SECURED means that no protection is set.

lock();

Parameters

  • None.

Return

  • lock : SystemLock, Current locking state of the screen, NOT_SECURED means that no protection is set

screen

Retrieve the Current illumination state of the screen.

screen();

Parameters

  • None.

Return

  • screen : SystemScreen, Current illumination state of the screen

services

Retrieve the Services running on the device..

services();

Parameters

  • None.

Return

  • services : List<Service>, Services running on the device.

timestamp

Retrieve the represents the time of the operation..

timestamp();

Parameters

  • None.

Return

  • timestamp : Long, represents the time of the operation.

data

Returns every available seed.

data();

Parameters

  • None.

Returns

onScreenUnlocked

Starts a listener on the system screen and executes some actions when it changes.

onScreenUnlocked(callback);

Parameters

Return

  • token : Token used for canceling event listener.

onScreenStateChanged

Starts a listener on the system screenState and executes some actions when it changes.

onScreenStateChanged(callback);

Parameters

Return

  • token : Token used for canceling event listener.

onForegroundAppChanged

Starts a listener on the system foregroundApp and executes some actions when it changes.

onForegroundAppChanged(callback);

Parameters

Return

  • token : Token used for canceling event listener.