Repository navigation
Javascript API
The following APIs are in progress and likely to change.
The “ti” object is the main interface that the application will interact with the gain access to Titanium services.
include(url)
include a javascript at the given URL
debug(message)
debug a message to the console
hide
hide the app
show
show the app
activate – same as restore in win32
beep
playSound(sound)
playNamedSound(soundName)
quit
setIcon(icon)
setBadge(badge)
sets the value on the badge (if supported by platform). if null is passed, no badge will be shown.
notify(severity)
open(path, mode)
path: The absolute path of the file to open.
mode: “r” for read, “rw” for read-write, “w” for write.
Returns a TiFile object
read()
Returns the contents of the file as a string
write(contents)
Writes the string contents to the file
createSystemMenu(iconURL, caption, callback)
Create a system menu with an Icon at iconURL, with the given caption. The callback object will be called when it’s time to create the menu.
createUserMenu
returns an instance of the TiUserMenu class
createWindow
Returns an instance of the TiUserWindow class
TiUserWindow
get/setID
get/setX
get/setY
get/setWidth
get/setHeight
get/setBounds
get/setTitle
get/setURL
is/setResizable
is/setMaximizable
is/setMinimizable
is/setCloseable
is/setFullscreen
is/setVisible
is/setUsingChrome
is/setUsingScrollbars
get/setTransparency
hide
show
close
addItem
get/setDisplay
get/setIcon
get/setAction
addItem
addSeparator
hide
show