Titanium.Platform

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

Summary

The top level Platform module. The Platform module is used accessing the device's platform related functionality.

Objects

Name Summary
Titanium.Platform.DisplayCaps

The Display Caps object returned by the Titanium.Platform.displayCaps property.

Methods

Name Summary
addEventListener

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

canOpenURL

returns whether or not a system URL can be opened. (iPhone, iPad, Mobile Web only.)

createUUID

create a globally unique identifier

fireEvent

Fires a synthesized event to any registered listeners.

is24HourTimeFormat

Whether device settings are set to show times in 24-hour format. (Android, iPhone, iPad only.)

openURL

open a URL in the system default manner

removeEventListener

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

Properties

Name Type Summary
BATTERY_STATE_CHARGING Number

the device is plugged in and currently being charged read-only

BATTERY_STATE_FULL Number

the battery is fully charged read-only

BATTERY_STATE_UNKNOWN Number

the battery state is unknown or not monitoring is not enabled read-only

BATTERY_STATE_UNPLUGGED Number

the device is unplugged read-only

address String

the ip address that the device reports (only applicable on WIFI network) read-only

architecture String

the processor architecture that the device reports read-only

availableMemory Number

return the amount of memory available on the device in bytes read-only

batteryLevel Number

the current device battery level. this property is only accessible if batteryMonitoring is enabled. on iPhone, this level only changes at 5% intervals. read-only

batteryMonitoring Boolean

boolean to indicate if battery monitoring is enabled read-only

batteryState Number

constant that represents the state of the battery. this property is only accessible if batteryMonitoring is enabled read-only

displayCaps Titanium.Platform.DisplayCaps

return the DisplayCaps object for platform read-only

id String

Deprecated the unique id of the device read-only

locale String

the primary language of the device that the user has enabled read-only

macaddress String

this property will return a unique identifier for the device read-only

model String

the model of the phone that the device reports (Android, iPhone, iPad only.) read-only

name String

the name of the platform returned by the device read-only

netmask String

the network mask that the device reports (only applicable on WIFI network) read-only

osname String

the shortname of the operating system. for example, on an iPhone, will return iphone, iPad will return ipad, Android will return android and Mobile Web will return mobileweb. read-only

ostype String

the OS architecture, such as 32 bit read-only

processorCount Number

the number of processors the device reports read-only

runtime String

Short name for the JavaScript runtime in use. read-only

username String

the username of the device, if set read-only

version String

the version of the platform returned by the device read-only

Events

Name Summary
battery

fired when the battery state changes. the battery state changes are only tracked on iPhone/iPad at 5% increments. (Android, iPhone, iPad only.)