Implementation Titanium

The following example shows the basic installation for the Titanium platform. When generating the object SpringMobile a site identifier (<site>) has to be indicated, which is shipped together with this documentation and the libraries.

/*
 * Importing SpringMobile
 */
Ti.include("titaniumSpring.js");

/*
 * Generating SpringMobile entity with site id and
 * application name
 */
var springMobile = new SpringMobile("<site>", "myApplication1");

var request = new Array();
/*
 * Sending the start of the application to the measurement system
 */
request[VAR_ACTION] = APP_STARTED;
var sent = springMobile.commit(request);

/*
 * Example: Sending the action spring.BACKGROUND
 */
var request = new Array();
request[VAR_ACTION] = APP_BACKGROUND;
var sent = springMobile.commit(request);