Titanium.App

Submodule of Titanium.
Platform Since
Android 0.1
iPhone 0.1
iPad 0.1
Mobile Web 1.8

Summary

The top level App module. The App module is mainly used for accessing information about the application at runtime.

Description

The App module exposes a number of properties set in the tiapp.xml file.

Three of these properties, the application name, ID, and URL, must be specified when the application is created.

While most values may be changed by editing the tiapp.xml file after creating the project, the GUID is automatically generated and should not be changed.

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

fireEvent

Fires a synthesized event to any registered listeners.

getAnalytics

Gets the value of the analytics property.

getArguments

Returns the arguments passed to the application on startup. (iPhone, iPad only.)

getCopyright

Gets the value of the copyright property.

getDeployType

Gets the value of the deployType property.

getDescription

Gets the value of the description property.

getGuid

Gets the value of the guid property.

getId

Gets the value of the id property.

getIdleTimerDisabled

Gets the value of the idleTimerDisabled property. (iPhone, iPad only.)

getName

Gets the value of the name property.

getProximityDetection

Gets the value of the proximityDetection property. (iPhone, iPad only.)

getProximityState

Gets the value of the proximityState property. (iPhone only.)

getPublisher

Gets the value of the publisher property.

getSessionId

Gets the value of the sessionId property.

getUrl

Gets the value of the url property.

getVersion

Gets the value of the version property.

removeEventListener

Removes the specified callback as an event listener for the named event.

setIdleTimerDisabled

Sets the value of the idleTimerDisabled property. (iPhone, iPad only.)

setProximityDetection

Sets the value of the proximityDetection property. (iPhone, iPad only.)

Properties

Name Type Summary
analytics Boolean

Whether or not Analytics are enabled, from tiapp.xml. read-only

copyright String

Application copyright statement, from tiapp.xml. read-only

deployType String

Application build type indicating how it was packaged; either test, development or production. read-only

description String

Application description, from tiapp.xml. read-only

guid String

Application globally-unique ID, from tiapp.xml. read-only

id String

Application ID, from tiapp.xml. read-only

idleTimerDisabled Boolean

Determines whether the screen is locked when the device is idle. (iPhone, iPad only.)

name String

Application name, from tiapp.xml. read-only

proximityDetection Boolean

Determines whether proximity detection is enabled. (iPhone, iPad only.)

proximityState Boolean

Indicates the state of the device's proximity sensor, according to the Titanium.App.proximity event. (iPhone only.) read-only

publisher String

Application publisher, from tiapp.xml. read-only

sessionId String

Unique session identifier for the current continuous run of the application. read-only

url String

Application URL, from tiapp.xml. read-only

version String

Application version, from tiapp.xml. read-only

Events

Name Summary
pause

Fired when the application transitions to the background. (iPhone, iPad only.)

proximity

Fired when the proximity sensor changes state. (iPhone only.)

resume

Fired when the application transitions to the foreground of a multitasked system. (iPhone, iPad only.)

resumed

Fired when the application has returned to the foreground. (iPhone, iPad only.)