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 in the new project wizard when you create an application.

Most values can be changed by editing the tiapp.xml file after creating the project. However, the GUID property 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.

getArguments

Return the arguments passed to the application on startup as a dictionary. (iPhone, iPad only.)

getCopyright

Gets the value of the copyright 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, iPad only.)

getPublisher

Gets the value of the publisher 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
copyright String

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

description String

Application's description, from tiapp.xml. read-only

guid String

Application's globally unique id, from tiapp.xml read-only

id String

Application's app ID, from tiapp.xml. read-only

idleTimerDisabled Boolean

Controls whether the phone screen will be locked on idle time. (iPhone, iPad only.)

name String

Application's name, from tiapp.xml. read-only

proximityDetection Boolean

Boolean to indicate whether proximity detection is enabled. (iPhone, iPad only.)

proximityState Boolean

State of the device's proximity sensor. (iPhone, iPad only.) read-only

publisher String

Application's publisher, from tiapp.xml. 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 an iOS application will stop being the focus. (iPhone, iPad only.)

proximity

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

resume

Fired when an iOS application will enter the foreground due to iOS 4's multitasking. (iPhone, iPad only.)

resumed

Fired when an iOS application will return to being the focus. (iPhone, iPad only.)