| Platform | Since |
|---|---|
| Android | 0.1 |
| iPhone | 0.1 |
| iPad | 0.1 |
| Mobile Web | 1.8 |
The top-level Titanium module.
The Titanium module provides the Titanium Mobile API, allowing developers to access native features of each target environment. Currently, the Android, iOS and Mobile Web (beta) environments are supported.
The complete Titanium API is accessible from the Titanium namespace but, for convenience and
brevity, the alias Ti is also provided. As the Titanium namespace is functionally-identical
to its Ti alias, it is always recommended to use Ti in your code.
For example, the following pairs of Titanium calls behave exactly the same.
Titanium.API.info('Hello Titanium!'); Ti.API.info('Hello Titanium!'); Titanium.Utils.sha256('Hello Titanium!'); Ti.Utils.sha256('Hello Titanium!'); Titanium.App.Properties.setString('hello_msg','Hello Titanium!'); Ti.App.Properties.setString('hello_msg','Hello Titanium!'); Titanium.Database.open('mydb'); Ti.Database.open('mydb');
Titanium includes a number of built-in JavaScript objects that are not part of the Titanium
namespace, including JSON parsing, String formatting, timers, and the CommonJS require function.
See Global APIs for details.
| Name | Summary |
|---|---|
| Titanium.Blob |
The blob is an abstract data type that represents binary information, often obtained through HTTPClient or via files. It often is used to store text or the actual data of an image. (Android, iPhone, iPad only.) |
| Titanium.BlobStream |
Wrapper around |
| Titanium.Buffer |
Buffer is a container for raw data. A buffer is created by the method |
| Titanium.BufferStream |
Wrapper around |
| Titanium.Event |
The base type for all Titanium events. (Android, iPhone, iPad only.) |
| Titanium.IOStream |
IOStream is the interface that all stream types implement (Android, iPhone, iPad only.) |
| Name | Summary |
|---|---|
| addEventListener |
Adds the specified callback as an event listener for the named event. |
| createBuffer |
Creates a new buffer based on the params. (Android, iPhone, iPad only.) |
| fireEvent |
Fires a synthesized event to any registered listeners. |
| getBuildDate |
Gets the value of the buildDate property. |
| getBuildHash |
Gets the value of the buildHash property. |
| getUserAgent |
Gets the value of the userAgent property. |
| getVersion |
Gets the value of the version property. |
| include |
Includes JavaScript code from one or more files. |
| removeEventListener |
Removes the specified callback as an event listener for the named event. |
| setUserAgent |
Sets the value of the userAgent property. |
| Name | Type | Summary |
|---|---|---|
| buildDate | String |
Date of the Titanium build. read-only |
| buildHash | String |
Git hash of the Titanium build. read-only |
| userAgent | String |
User-agent string used by Titanium. |
| version | Number |
Version of Titanium that is executing. read-only |