Skip to content

Titanium.Android

The top-level Android module.

The Android module allows the application to manage various Android components.

Action Bar

An action bar is a UI feature that identifies the application and user location, and provides user actions and navigation modes.

The Titanium SDK lets you customize the look of the action bar and add action items. Action items are added using the Titanium.Android.Menu API.

For more information about the action bar, see the Titanium.Android.ActionBar API reference.

Activities

An Android application is made up of one or more activities. Each activity represents a single screen with a user interface.

In Titanium, each Window or TabGroup has its own activity. The application can access the activity of a Window and TabGroup object and monitor its lifecycle events. Titanium also lets you launch new activities by creating intents to launch them. See the "Intents" section below.

For more information about activities, see the Titanium.Android.Activity API reference.

Broadcast Intents and Receivers

Broadcast Intents allow your application to send out a message to any application that sets up a Broadcast Receiver to listen to it. Your application can also register Broadcast Receivers to listen to system events sent by the Android OS, such as low battery warnings or airplane mode changes.

For more information about broadcasts, see the Android Broadcast Intents and Receivers guide and Titanium.Android.BroadcastReceiver API reference.

Intents

Intents are message objects that specify actions to perform which can start either activities, broadcasts or services.

For more information about intents, see the Titanium.Android.Intent API reference.

Intent Filters

Intent Filters advertise to the Android OS that your application handles certain actions and data types. For example, when another application wants to share an image or text, your application can define intent filters to let Android know your application can handle those data types.

For more information about intent filters, see the Android Intent Filters guide.

Notifications

Notifications alert the user that something is happening to your application while it is in the background. Notifications appear in the notification drawer until the user clears them and on the lock screen for devices running Android 5.0 or greater. Note that the user can filter or turn notifications on and off from Settings. For more information about notifications, see the Titanium.Android.Notification API reference.

For Android toast notifications (pop-up notifications sent while the application is in the foreground), see Titanium.UI.Notification.

Options Menu

The options menu is a feature of older Android devices (prior to Android 3.0 (API 11)), and has been replaced by the action bar. The options menu is accessed by pressing the Menu and presents a pop-up menu of options the user can execute.

The Titanium.Android.Menu API is used to construct both the options menu and action items for the action bar.

For more information about the options menu, see the Titanium.Android.Menu API reference.

Services

A service is a component started by an application that runs in the background. The service does not have any application UI associated with it, so the user does not directly interact with it, only your application.

The Titanium SDK gives you the ability to write your own Android Services using JavaScript. The service executes your JavaScript code at intervals you specify. Note that the service will stop running when you back out of the app. So, if you want the service to continue running, then it's recommended that you set the root window's exitOnClose property to false so that the window will persist in the background like iOS.

For more information about services, see the Titanium.Android.Service API reference.

Permissions

Starting from Android 6.0 (API level 23), users need to grant certain permissions to apps while the app is running. You can read it more here. Starting with Android 13 you have to use more granular media permissions. Check the official documentation. Make sure to add e.g. <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> to your tiapp.xml too.

In Titanium SDK, to support this, we have the Titanium.Android.requestPermissions method. It is used to request any permission you may need. An example of using it is shown below:

var permissions = [ 'android.permission.CAMERA', 'android.permission.READ_EXTERNAL_STORAGE', 'android.permission.WRITE_EXTERNAL_STORAGE' ];
if (Ti.Platform.versionMajor >= 13) {
  // example for camera and image permission on Android 13
  permissions = [ 'android.permission.CAMERA', 'android.permission.READ_MEDIA_IMAGES' ]
}
Ti.Android.requestPermissions(permissions, function (e) {
    if (e.success) {
        Ti.API.info('SUCCESS');
    } else {
        Ti.API.info('ERROR: ' + e.error);
    }
});

Extends: Titanium.Module · Since: 1.5 · Platforms: android

Properties #

ACTION_AIRPLANE_MODE_CHANGED#

Type: String

User switched airplane mode on or off.

ACTION_ALL_APPS#

Type: String

List all applications.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_ALL_APPS in the Android API Reference.

ACTION_ANSWER#

Type: String

Handle an incoming phone call.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_ANSWER in the Android API Reference.

ACTION_ATTACH_DATA#

Type: String

Used to indicate that the data is an attachment.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_ATTACH_DATA in the Android API Reference.

ACTION_BATTERY_CHANGED#

Type: String

Listen to battery state change status.

Pass to the Titanium.Android.registerBroadcastReceiver method to listen to the system broadcast.

Note that Titanium exposes battery monitoring using the Titanium.Platform API.

See Intent.ACTION_BATTERY_CHANGED in the Android API Reference.

ACTION_BATTERY_LOW#

Type: String

Indicates low battery condition on the device.

Pass to the Titanium.Android.registerBroadcastReceiver method to listen to the system broadcast.

Note that Titanium exposes battery monitoring using the Titanium.Platform API.

See Intent.ACTION_BATTERY_LOW in the Android API Reference.

ACTION_BATTERY_OKAY#

Type: String

Indicates the battery is now okay after being low.

Pass to the Titanium.Android.registerBroadcastReceiver method to listen to the system broadcast.

Note that Titanium exposes battery monitoring using the Titanium.Platform API.

See Intent.ACTION_BATTERY_OKAY in the Android API Reference.

ACTION_BOOT_COMPLETED#

Type: String

Indicates the system has finished booting.

Pass to the Titanium.Android.registerBroadcastReceiver method to listen to the system broadcast.

The application needs to also set the android.permission.RECEIVE_BOOT_COMPLETED permission
in the Android manifest section of the tiapp.xml file.

<ti:app>
    <android>
        <manifest>
            <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
        </manifest>
    </android>
</ti:app>

See Intent.ACTION_BOOT_COMPLETED in the Android API Reference.

ACTION_BUG_REPORT#

Type: String

Show activity for reporting a bug.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_BUG_REPORT in the Android API Reference.

ACTION_CALL#

Type: String

Perform a call to someone specified by the data property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_CALL in the Android API Reference.

ACTION_CALL_BUTTON#

Type: String

User pressed the call button.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_CALL_BUTTON in the Android API Reference.

ACTION_CAMERA_BUTTON#

Type: String

The camera button was pressed.

ACTION_CHOOSER#

Type: String

Display an activity chooser.

Use with the Titanium.Android.Intent.action property to create an Activity Chooser.

You can also create an activity chooser using the Titanium.Android.createIntentChooser method.

See Intent.ACTION_CHOOSER in the Android API Reference.

ACTION_CLOSE_SYSTEM_DIALOGS#

Type: String

User dismissed a temporary system dialog, such as the notification drawer or recent-app drawer.

ACTION_CONFIGURATION_CHANGED#

Type: String

The device's configuration changed.

ACTION_CREATE_SHORTCUT#

Type: String

Create a shortcut.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_CREATE_SHORTCUT in the Android API Reference.

ACTION_DATE_CHANGED#

Type: String

Date changed.

ACTION_DEFAULT#

Type: String

Default action, which is Titanium.Android.ACTION_VIEW

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_DEFAULT in the Android API Reference.

ACTION_DELETE#

Type: String

Delete the data specified by the Intent's data property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_DELETE in the Android API Reference.

ACTION_DEVICE_STORAGE_LOW#

Type: String

Indicates a low memory condition on the device.

ACTION_DIAL#

Type: String

Dial a number specified by the Intent's data property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_DIAL in the Android API Reference.

ACTION_EDIT#

Type: String

Provide editable access to the data specified by the Intent's data property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_EDIT in the Android API Reference.

ACTION_GET_CONTENT#

Type: String

Allow the user to select a particular kind of data specified by the Intent's type property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_GET_CONTENT in the Android API Reference.

ACTION_GTALK_SERVICE_CONNECTED#

Type: String

GTalk connection has been established.

ACTION_GTALK_SERVICE_DISCONNECTED#

Type: String

GTalk connection has been disconnected.

ACTION_HEADSET_PLUG#

Type: String

A wired headset has been plugged in or unplugged.

ACTION_INPUT_METHOD_CHANGED#

Type: String

An input method has been changed.

ACTION_INSERT#

Type: String

Insert an empty item into the given container.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_INSERT in the Android API Reference.

ACTION_INSERT_OR_EDIT#

Type: String

Pick an existing item or insert an empty item, then edit it.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_INSERT_OR_EDIT in the Android API Reference.

ACTION_MAIN#

Type: String

Start as the main entry point.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_MAIN in the Android API Reference.

ACTION_MANAGE_PACKAGE_STORAGE#

Type: String

Indicates low memory condition notification acknowledged by user and package management should be started.

ACTION_MEDIA_BAD_REMOVAL#

Type: String

External media was removed from SD card slot, but mount point was not unmounted.

ACTION_MEDIA_BUTTON#

Type: String

The media button was pressed.

ACTION_MEDIA_CHECKING#

Type: String

External media is present and being disk-checked.

ACTION_MEDIA_EJECT#

Type: String

User has expressed the desire to remove the external storage media.

Pass to the Titanium.Android.registerBroadcastReceiver method to listen to the system broadcast.

Applications should close all files they have open within the mount point when they receive this intent.

See Intent.ACTION_MEDIA_EJECT in the Android API Reference.

ACTION_MEDIA_MOUNTED#

Type: String

External media is present and mounted at its mount point.

ACTION_MEDIA_NOFS#

Type: String

External media is present, but is using an incompatible filesystem or is blank.

ACTION_MEDIA_REMOVED#

Type: String

External media has been removed.

ACTION_MEDIA_SCANNER_FINISHED#

Type: String

The media scanner has finished scanning a directory.

ACTION_MEDIA_SCANNER_SCAN_FILE#

Type: String

Request the media scanner to scan a file and add it to the media database.

ACTION_MEDIA_SCANNER_STARTED#

Type: String

The media scanner has started scanning a directory.

ACTION_MEDIA_SHARED#

Type: String

External media is unmounted because it is being shared via USB mass storage.

ACTION_MEDIA_UNMOUNTABLE#

Type: String

Corresponds to the Android Intent.ACTION_MEDIA_UNMOUNTABLE constant.

ACTION_MEDIA_UNMOUNTED#

Type: String

External media is present, but not mounted at its mount point.

ACTION_NEW_OUTGOING_CALL#

Type: String

An outgoing call is about to be placed.

Pass to the Titanium.Android.registerBroadcastReceiver method to listen to the system broadcast.

The application needs to also set the android.permission.NEW_OUTGOING_CALL permission
in the Android manifest section of the tiapp.xml file.

<ti:app>
    <android>
        <manifest>
            <uses-permission android:name="android.permission.NEW_OUTGOING_CALL"/>
        </manifest>
    </android>
</ti:app>

See Intent.ACTION_NEW_OUTGOING_CALL in the Android API Reference.

ACTION_PACKAGE_ADDED#

Type: String

A new application package has been installed on the device.

ACTION_PACKAGE_CHANGED#

Type: String

An existing application package has been changed.

ACTION_PACKAGE_DATA_CLEARED#

Type: String

The user has cleared the data of a package.

ACTION_PACKAGE_REMOVED#

Type: String

An existing application package has been removed from the device.

ACTION_PACKAGE_REPLACED#

Type: String

A new version of an application package has been installed, replacing an existing version that was previously installed.

ACTION_PACKAGE_RESTARTED#

Type: String

The user has restarted a package, and all of its processes have been killed.

ACTION_PICK#

Type: String

Pick an item from the directory indicated by the Intent's data property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_PICK in the Android API Reference.

ACTION_PICK_ACTIVITY#

Type: String

Pick an activity given an intent.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

Add the activity intent using the intent's putExtra() method. Pass the method
Titanium.Android.EXTRA_INTENT as the name parameter and the activity intent
as the data parameter.

See Intent.ACTION_PICK_ACTIVITY in the Android API Reference.

ACTION_POWER_CONNECTED#

Type: String

External power has been connected to the device.

ACTION_POWER_DISCONNECTED#

Type: String

External power has been disconnected from the device.

ACTION_POWER_USAGE_SUMMARY#

Type: String

Show power usage information to the user.

ACTION_PROVIDER_CHANGED#

Type: String

Content provider published new events or items.

ACTION_REBOOT#

Type: String

Device rebooted.

ACTION_RUN#

Type: String

Run the data.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_RUN in the Android API Reference.

ACTION_SCREEN_OFF#

Type: String

Sent when the device goes to sleep and becomes non-interactive.

ACTION_SCREEN_ON#

Type: String

Sent when the device wakes up and becomes interactive.

Type: String

Perform a search.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SEARCH in the Android API Reference.

ACTION_SEARCH_LONG_PRESS#

Type: String

Start action associated with long pressing on the search key.

ACTION_SEND#

Type: String

Deliver data to another activity.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SEND in the Android API Reference.

ACTION_SEND_MULTIPLE#

Type: String

Deliver multiple data to another activity.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SEND_MULTIPLE in the Android API Reference.

ACTION_SENDTO#

Type: String

Deliver data to the recipient specified by the Intent's data property.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SENDTO in the Android API Reference.

ACTION_SET_WALLPAPER#

Type: String

Show settings for choosing the system wallpaper.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SET_WALLPAPER in the Android API Reference.

ACTION_SHUTDOWN#

Type: String

Device is shutting down.

ACTION_SYNC#

Type: String

Perform data synchronization.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SYNC in the Android API Reference.

ACTION_SYSTEM_TUTORIAL#

Type: String

Start the platform-defined tutorial.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_SYSTEM_TUTORIAL in the Android API Reference.

ACTION_TIME_CHANGED#

Type: String

The time was set.

ACTION_TIME_TICK#

Type: String

The current time changed. Sent every minute.

ACTION_UID_REMOVED#

Type: String

A user ID was removed from the system.

ACTION_USER_PRESENT#

Type: String

Sent when the user is present after device wakes up.

ACTION_VIEW#

Type: String

Display data to the user.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_VIEW in the Android API Reference.

ACTION_VOICE_COMMAND#

Type: String

Start voice command.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_VOICE_COMMAND in the Android API Reference.

ACTION_WALLPAPER_CHANGED#

Type: String

The current system wallpaper has changed.

Type: String

Perform a web search.

Use with the Titanium.Android.Intent.action property to create an Activity Intent.

See Intent.ACTION_WEB_SEARCH in the Android API Reference.

apiName#

extended

Type: String

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button
returns Ti.UI.Button.

bubbleParent#

extended

Type: Boolean

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often
established by the add() method. For example, for a button added to a window, a
click event on the button would bubble up to the window. Other common parents are
table sections to their rows, table views to their sections, and scrollable views
to their views. Set this property to false to disable the bubbling to the proxy's parent.

CATEGORY_ALARM#

Type: String

Notification category indicating an alarm or timer.

CATEGORY_ALTERNATIVE#

Type: String

Set if the activity should be considered as an alternative action to the data the user is currently viewing.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_ALTERNATIVE in the Android API Reference.

CATEGORY_BROWSABLE#

Type: String

Activity can browse the Internet.

Pass to the Intent's addCategory() method to set a category.

The Titanium.Android.ACTION_MAIN constant must also be set in the intent's action property.

See Intent.CATEGORY_BROWSABLE in the Android API Reference.

CATEGORY_CALL#

Type: String

Notification category indicating an incoming call (voice or video) or similar synchronous
communication request.

CATEGORY_DEFAULT#

Type: String

Activity should be used as the default action to perform on a piece of data.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_DEFAULT in the Android API Reference.

CATEGORY_DEVELOPMENT_PREFERENCE#

Type: String

Activity is in the development preference panel.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_DEVELOPMENT_PREFERENCE in the Android API Reference.

CATEGORY_EMAIL#

Type: String

Notification category indicating an asynchronous bulk message (email).

CATEGORY_EMBED#

Type: String

Activity can run inside a parent activity.

CATEGORY_ERROR#

Type: String

Notification category indicating an error in background operation or authentication status.

CATEGORY_EVENT#

Type: String

Notification category indicating a calendar event.

CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST#

Type: String

To be used as test code for framework instrumentation tests.

CATEGORY_HOME#

Type: String

Home activity, the first activity that is displayed when the device boots.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_HOME in the Android API Reference.

CATEGORY_INFO#

Type: String

Provides information about the package it is in.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_INFO in the Android API Reference.

CATEGORY_LAUNCHER#

Type: String

Activity is in the device's launcher.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_LAUNCHER in the Android API Reference.

CATEGORY_MESSAGE#

Type: String

Notification category indicating an incoming direct message (SMS, instant message, etc.).

CATEGORY_MONKEY#

Type: String

This activity may be exercised by the monkey or other automated test tools.

CATEGORY_OPENABLE#

Type: String

Activity can open raw file:// or scheme:// URIs.

CATEGORY_PREFERENCE#

Type: String

This activity is a preference panel.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_PREFERENCE in the Android API Reference.

CATEGORY_PROGRESS#

Type: String

Notification category indicating the progress of a long-running background operation.

CATEGORY_PROMO#

Type: String

Notification category indicating a promotion or advertisement.

CATEGORY_RECOMMENDATION#

Type: String

Notification category indicating a specific, timely recommendation for a single thing.

CATEGORY_SAMPLE_CODE#

Type: String

To be used as a sample code example (not part of the normal user experience).

CATEGORY_SELECTED_ALTERNATIVE#

Type: String

Activity should be considered as an alternative selection action to the data the user
has currently selected.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_SELECTED_ALTERNATIVE in the Android API Reference.

CATEGORY_SERVICE#

Type: String

Notification category for a running background service.

CATEGORY_SOCIAL#

Type: String

Notification category for a social network or sharing update.

CATEGORY_STATUS#

Type: String

Notification category indicating ongoing information about device or contextual status.

CATEGORY_TAB#

Type: String

Activity to be used in a tab activity.

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_TAB in the Android API Reference.

CATEGORY_TEST#

Type: String

To be used as a test (not part of the normal user experience).

Pass to the Intent's addCategory() method to set a category.

See Intent.CATEGORY_TEST in the Android API Reference.

CATEGORY_TRANSPORT#

Type: String

Notification category indicating media transport control for playback.

CATEGORY_UNIT_TEST#

Type: String

To be used as a unit test (run through the Test Harness).

currentActivity#

Type: Titanium.Android.Activity

References the top-most window's activity.

currentService#

Type: Titanium.Android.Service

Service in the active context.

DEFAULT_ALL#

Type: Number

Use all default settings for a notification; see
Notification.defaults.

DEFAULT_LIGHTS#

Type: Number

Use the default light settings for a notification; see
Notification.defaults.

DEFAULT_SOUND#

Type: Number

Use the default sound settings for a notification; see
Notification.defaults.

DEFAULT_VIBRATE#

Type: Number

Use the default vibration settings for a notification; see
Notification.defaults.

EXTRA_ALARM_COUNT#

Type: String

Integer indicating how many pending alarms are being delivered with the intent.

EXTRA_BCC#

Type: String

String array containing e-mail addresses for blind carbon copying.

EXTRA_CC#

Type: String

String array containing e-mail addresses for carbon copying.

EXTRA_DATA_REMOVED#

Type: String

Boolean indicating full uninstall (true) or partial uninstall (false).

Sent with the Titanium.Android.ACTION_PACKAGE_REMOVED broadcast.

See Intent.EXTRA_DATA_REMOVED in the Android API Reference.

EXTRA_DONT_KILL_APP#

Type: String

Boolean indicating to restart the application or not.

Sent with the Titanium.Android.ACTION_PACKAGE_REMOVED and
Titanium.Android.ACTION_PACKAGE_CHANGED broadcasts.

See Intent.EXTRA_DONT_KILL_APP in the Android API Reference.

EXTRA_EMAIL#

Type: String

String array containing e-mail addresses.

EXTRA_INTENT#

Type: String

An Intent describing the choices you would like shown.

Set if the Intent's action is Titanium.Android.ACTION_PICK_ACTIVITY.

See Intent.EXTRA_INTENT in the Android API Reference.

EXTRA_KEY_EVENT#

Type: String

A KeyEvent object containing the event that triggered the creation of the Intent it is in.

EXTRA_PHONE_NUMBER#

Type: String

String holding the phone number to call or number that was called.

Sent with the Titanium.Android.ACTION_NEW_OUTGOING_CALL broadcast.

Set if the Intent's action is Titanium.Android.ACTION_CALL.

See Intent.EXTRA_PHONE_NUMBER in the Android API Reference.

EXTRA_REPLACING#

Type: String

Boolean indicating if the package is being replaced.

Sent with the Titanium.Android.ACTION_PACKAGE_REMOVED broadcast.

See Intent.EXTRA_REPLACING in the Android API Reference.

EXTRA_SHORTCUT_ICON#

Type: String

Bitmap icon.

Return value of an intent with a Titanium.Android.ACTION_CREATE_SHORTCUT action.

See Intent.EXTRA_SHORTCUT_ICON in the Android API Reference.

EXTRA_SHORTCUT_ICON_RESOURCE#

Type: String

Resource of the shortcut.

Return value of an intent with a Titanium.Android.ACTION_CREATE_SHORTCUT action.

See Intent.EXTRA_SHORTCUT_ICON_RESOURCE in the Android API Reference.

EXTRA_SHORTCUT_INTENT#

Type: String

Intent of a shortcut.

Return value of an intent with a Titanium.Android.ACTION_CREATE_SHORTCUT action.

See Intent.EXTRA_SHORTCUT_INTENT in the Android API Reference.

EXTRA_SHORTCUT_NAME#

Type: String

Name of the shortcut.

Return value of an intent with a Titanium.Android.ACTION_CREATE_SHORTCUT action.

See Intent.EXTRA_SHORTCUT_NAME in the Android API Reference.

EXTRA_STREAM#

Type: String

URI containing the stream data.

Use if the Intent's action is Titanium.Android.ACTION_SEND.

See Intent.EXTRA_STREAM in the Android API Reference.

EXTRA_SUBJECT#

Type: String

Subject line of a message.

EXTRA_TEMPLATE#

Type: String

Initial data to place in a newly created record.

Use if the Intent's action is Titanium.Android.ACTION_INSERT.

See Intent.EXTRA_TEMPLATE in the Android API Reference.

EXTRA_TEXT#

Type: String

Corresponds to the Android Intent.EXTRA_TEXT constant.

EXTRA_TITLE#

Type: String

Corresponds to the Android Intent.EXTRA_TITLE constant.

Set if the Intent's action is Titanium.Android.ACTION_CHOOSER.

See Intent.EXTRA_TITLE in the Android API Reference.

EXTRA_UID#

Type: String

UID of the assigned packaged.

Sent with the Titanium.Android.ACTION_UID_REMOVED broadcast, and may be sent with the
Titanium.Android.ACTION_PACKAGE_CHANGED and Titanium.Android.ACTION_PACKAGE_REMOVED broadcasts.

See Intent.EXTRA_UID in the Android API Reference.

FILL_IN_ACTION#

Type: Number

Not used.

FILL_IN_CATEGORIES#

Type: Number

Not used.

FILL_IN_COMPONENT#

Type: Number

Not used.

FILL_IN_DATA#

Type: Number

Not used.

FILL_IN_PACKAGE#

Type: Number

Not used.

FLAG_ACTIVITY_BROUGHT_TO_FRONT#

Type: Number

If activity is already running, bring it to the foreground.

Set by the system when launching a task.

See Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT in the Android API Reference.

FLAG_ACTIVITY_CLEAR_TOP#

Type: Number

If the activity is present, removes any activities on top of it to make it the foreground activity.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_CLEAR_TOP in the Android API Reference.

FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET#

Type: Number

Corresponds to the Android Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET constant.

FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS#

Type: Number

Exclude the activity from recently launched activities.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS in the Android API Reference.

FLAG_ACTIVITY_FORWARD_RESULT#

Type: Number

Return result to the original calling activity.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_FORWARD_RESULT in the Android API Reference.

FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY#

Type: Number

Activity was launched from history.

FLAG_ACTIVITY_MULTIPLE_TASK#

Type: Number

Start the activity as a new task even if it exists.

Must be used with the Titanium.Android.FLAG_ACTIVITY_NEW_TASK.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_MULTIPLE_TASK in the Android API Reference.

FLAG_ACTIVITY_NEW_TASK#

Type: Number

Activity will be the start of a new task (collection of activities).

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_NEW_TASK in the Android API Reference.

FLAG_ACTIVITY_NO_ANIMATION#

Type: Number

Prevent transition animation.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_NO_ANIMATION in the Android API Reference.

FLAG_ACTIVITY_NO_HISTORY#

Type: Number

Do not keep the activity in the history stack.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_NO_HISTORY in the Android API Reference.

FLAG_ACTIVITY_NO_USER_ACTION#

Type: Number

Disables the onUserLeaveHint() callback.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_NO_USER_ACTION in the Android API Reference.

FLAG_ACTIVITY_PREVIOUS_IS_TOP#

Type: Number

Corresponds to the Android Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP constant.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP in the Android API Reference.

FLAG_ACTIVITY_REORDER_TO_FRONT#

Type: Number

If the activity already exists, place it at the top of the history stack.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_REORDER_TO_FRONT in the Android API Reference.

FLAG_ACTIVITY_RESET_TASK_IF_NEEDED#

Type: Number

If the task already exists, resets the task to its initial state.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED in the Android API Reference.

FLAG_ACTIVITY_SINGLE_TOP#

Type: Number

Do not launch the activity if it is already running.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_ACTIVITY_SINGLE_TOP in the Android API Reference.

FLAG_AUTO_CANCEL#

Type: Number

Cancel the notification when it is clicked by the user.

FLAG_CANCEL_CURRENT#

Type: Number

Cancel the current pending intent before creating a new one.

FLAG_DEBUG_LOG_RESOLUTION#

Type: Number

Enable a log message to print out the resolution of the intent.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_DEBUG_LOG_RESOLUTION in the Android API Reference.

FLAG_FROM_BACKGROUND#

Type: Number

Indicates the intent is coming from a background operation.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_FROM_BACKGROUND in the Android API Reference.

FLAG_GRANT_READ_URI_PERMISSION#

Type: Number

Grant read permission on the URI in the Intent's data or clipboard.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_GRANT_READ_URI_PERMISSION in the Android API Reference.

FLAG_GRANT_WRITE_URI_PERMISSION#

Type: Number

Grants write permission on the URI in the Intent's data or clipboard.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_GRANT_WRITE_URI_PERMISSION in the Android API Reference.

FLAG_IMMUTABLE#

Type: Number

Pending intent should be immutable.

FLAG_INSISTENT#

Type: Number

Repeat audio until the notification is cancelled or the notification window
is opened.

FLAG_MUTABLE#

Type: Number

Pending intent should be mutable.

FLAG_NO_CLEAR#

Type: Number

Do not cancel the notification when the user clicks the Clear All button.

FLAG_NO_CREATE#

Type: Number

If the current intent does not exist, do not create it.

FLAG_ONE_SHOT#

Type: Number

The pending intent can only be used once.

FLAG_ONGOING_EVENT#

Type: Number

Specifies that a notification is in reference to something that is ongoing, like a phone call.

FLAG_ONLY_ALERT_ONCE#

Type: Number

Play an alert (sound, lights, and/or vibration) once each time the notification is sent, even if it has not been canceled before that.

FLAG_RECEIVER_REGISTERED_ONLY#

Type: Number

When sending a broadcast, only registered receivers will be called.

Bitwise-OR the constant with the Intent's flags property.

See Intent.FLAG_RECEIVER_REGISTERED_ONLY in the Android API Reference.

FLAG_SHOW_LIGHTS#

Type: Number

Use LED lights to alert the user to the notification.

FLAG_UPDATE_CURRENT#

Type: Number

If the current pending intent already exists, only update the current intent's extra data.

FOREGROUND_SERVICE_TYPE_CAMERA#

Type: Number

Allows the camera to be used while the app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="camera"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA
documentation for more details.

FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE#

Type: Number

Allows connecting to Android Auto, bluetooth, TV or other devices while app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="connectedDevice"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE
documentation for more details.

FOREGROUND_SERVICE_TYPE_LOCATION#

Type: Number

Allows accessing location from the GPS, map, etc. while the app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="location"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION
documentation for more details.

FOREGROUND_SERVICE_TYPE_MANIFEST#

Type: Number

A special value indicates to use all types set in manifest file.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST
documentation for more details.

FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK#

Type: Number

Allows music, video, news or other media playback while the app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="mediaPlayback"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
documentation for more details.

FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION#

Type: Number

Allows managing a media projection session for screen recording or taking screenshots
while app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="mediaProjection"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
documentation for more details.

FOREGROUND_SERVICE_TYPE_MICROPHONE#

Type: Number

Allows the microphone to be used while the app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="microphone"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
documentation for more details.

FOREGROUND_SERVICE_TYPE_NONE#

Type: Number

The default foreground service type.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE
documentation for more details.

FOREGROUND_SERVICE_TYPE_PHONE_CALL#

Type: Number

Allows ongoing phone call or video conferencing access while the app is in the background.

This constant is passed to the Titanium.Android.Service.foregroundNotify method.

To use this constant, you must also set your <service/> element to the
foregroundServiceType attribute value as shown below.

<ti:app>
    <android>
        <services>
            <service url="<YourService.js>" android:foregroundServiceType="phoneCall"/>
        </services>
    </android>
</ti:app>

See Google's ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL
documentation for more details.

IMPORTANCE_DEFAULT#

Type: Number

Used with NotificationChannel to specify an importance level.

IMPORTANCE_HIGH#

Type: Number

Used with NotificationChannel to specify an importance level.

IMPORTANCE_LOW#

Type: Number

Used with NotificationChannel to specify an importance level.

IMPORTANCE_MAX#

Type: Number

Used with NotificationChannel to specify an importance level.

IMPORTANCE_MIN#

Type: Number

Used with NotificationChannel to specify an importance level.

IMPORTANCE_NONE#

Type: Number

Used with NotificationChannel to specify an importance level.

IMPORTANCE_UNSPECIFIED#

Type: Number

Used with NotificationChannel to specify an importance level.

lifecycleContainer#

extended

Type: Titanium.UI.Window, Titanium.UI.TabGroup

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks
will also be called on the proxy. Proxies that require the activity lifecycle will need this property set
to the appropriate containing Window or TabGroup.

Type: Number

Standard Action Bar navigation mode.

Use with the Titanium.Android.ActionBar.navigationMode property. Note: NAVIGATION_MODE_STANDARD has been deprecated in API level 21 and up.

Type: Number

Action Bar tab navigation mode.

Use with the Titanium.Android.ActionBar.navigationMode property. Note: NAVIGATION_MODE_TABS has been deprecated in API level 21 and up.

PENDING_INTENT_FOR_ACTIVITY (deprecated)#

Type: Number

Not used.

PENDING_INTENT_FOR_BROADCAST (deprecated)#

Type: Number

Not used.

PENDING_INTENT_FOR_SERVICE (deprecated)#

Type: Number

Not used.

PENDING_INTENT_MAX_VALUE (deprecated)#

Type: Number

Not used.

PRIORITY_DEFAULT#

Type: Number

Default priority if it does not fit into another priority category.

PRIORITY_HIGH#

Type: Number

Use for high priority notifications like real-time chat messages.

PRIORITY_LOW#

Type: Number

Use for low priority notifications like software updates.

PRIORITY_MAX#

Type: Number

Use for urgent or time-critical notifications, for example, turn-by-turn directions or
emergency alerts.

PRIORITY_MIN#

Type: Number

Use for expired events.

Use with the Titanium.Android.Notification.priority property.

Note that the user will not be alerted to the notification (sound, vibration, etc.),
but the notification will appear in the drawer.

See also: Notification.PRIORITY_MIN in the Android API Reference.

R#

Type: Titanium.Android.R

Accessor for Android system resources.

To access your application's resources, use Titanium.App.Android.R.

RESULT_CANCELED#

Type: Number

Used with setResult to specify that
an activity was canceled.

RESULT_FIRST_USER#

Type: Number

Used with setResult to specify a
user-defined result.

User-defined result constants values start at RESULT_FIRST_USER.

RESULT_OK#

Type: Number

Used with setResult to specify that
an activity succeeded.

rootActivity#

Type: Titanium.Android.Activity

The first activity launched by the application.

This is the main launcher activity defined in the "AndroidManifest.xml" which shows the splash screen.
All windows opened are child activities below this root activity.

Closing this root activity via its finish() method will close
all of its child activity windows as well and exit out of the app.

When resuming the app via a data intent such as a URL, notification, shortcut, etc. the root activity
will fire a "newintent" event and update its intent property with
the newly received intent.

SCREEN_ORIENTATION_BEHIND#

Type: Number

Use with requestedOrientation to
specify the activity should run in the same orientation as the activity behind it
in the activity stack.

SCREEN_ORIENTATION_LANDSCAPE#

Type: Number

Use with requestedOrientation to
specify a landscape screen orientation.

SCREEN_ORIENTATION_NOSENSOR#

Type: Number

Use with requestedOrientation to
specify that the sensor should be ignored and the display should not rotate.

SCREEN_ORIENTATION_PORTRAIT#

Type: Number

Use with requestedOrientation to
specify a portrait screen orientation.

SCREEN_ORIENTATION_SENSOR#

Type: Number

Use with requestedOrientation to
specify that orientation should be determined by the orientation sensor.

SCREEN_ORIENTATION_UNSPECIFIED#

Type: Number

Use with requestedOrientation to
specify that the system should use its default rules for determining the best
orientation.

SCREEN_ORIENTATION_USER#

Type: Number

Use with requestedOrientation to
specify that the system should use the user's preferred orientation.

SHOW_AS_ACTION_ALWAYS#

Type: Number

Always show this item as an action button in the action bar.

Use with the MenuItem's Titanium.Android.MenuItem.showAsAction property.

SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW#

Type: Number

The action view can collapse to a normal menu item.

Use with the MenuItem's Titanium.Android.MenuItem.showAsAction property.

SHOW_AS_ACTION_IF_ROOM#

Type: Number

Show this item as an action button if the system decides there is room for it.

Use with the MenuItem's Titanium.Android.MenuItem.showAsAction property.

SHOW_AS_ACTION_NEVER#

Type: Number

Never display this item as an action button in the action bar.

Use with the MenuItem's Titanium.Android.MenuItem.showAsAction property.

SHOW_AS_ACTION_WITH_TEXT#

Type: Number

When this item is in the action bar, always show it with a text label.

Use with the MenuItem's Titanium.Android.MenuItem.showAsAction property.

START_NOT_STICKY#

Type: Number

A Service start mode indicating that if the host application is stopped by Android, the service should not be restarted automatically.

Use as a startMode value in the options object passed to
createServiceIntent.

START_REDELIVER_INTENT#

Type: Number

A Service start mode indicating that if the host application is stopped by Android, the service should be restarted automatically and the original Intent re-sent.

Use as a startMode value in the options object passed to
createServiceIntent.

STREAM_ALARM#

Type: Number

Use with audioStreamType to
request that the alarm stream type for notifications be used.

STREAM_DEFAULT#

Type: Number

Use with audioStreamType to request that the
default stream type for notifications be used.

STREAM_MUSIC#

Type: Number

Use with audioStreamType to
request that the music stream type for notifications be used.

STREAM_NOTIFICATION#

Type: Number

Use with audioStreamType to request that the
notification stream type for notifications be used.

STREAM_RING#

Type: Number

Use with audioStreamType to request that the
ring stream type for notifications be used.

STREAM_SYSTEM#

Type: Number

Use with audioStreamType to request that the
system stream type for notifications be used.

STREAM_VOICE_CALL#

Type: Number

Use with audioStreamType to request that the
voice call stream type for notifications be used.

TILE_STATE_ACTIVE#

Type: Number

QuickSettings tile is active.

The Tile is in enabled state and the user can interact with it.

TILE_STATE_INACTIVE#

Type: Number

QuickSettings tile is inactive.

The Tile is in disabled state, but the user can interact with it.

TILE_STATE_UNAVAILABLE#

Type: Number

QuickSettings tile is unavailable.

For some reason the Tile is not available to the user and will have no click action.

URI_INTENT_SCHEME#

Type: Number

The URI scheme used for intent URIs.

VISIBILITY_PRIVATE#

Type: Number

Shows basic information about the notification.

Use with the Titanium.Android.Notification.visibility property.

Only the application name and icon appear in the lock screen with the message: "Contents hidden".

See also: Notification.VISIBILITY_PRIVATE in the Android API Reference.

VISIBILITY_PUBLIC#

Type: Number

Shows the notification's full content on the lock screen. This is the system default if visibility is left unspecified.

VISIBILITY_SECRET#

Type: Number

Shows the most minimal information of the notification on the lock screen.

WAKE_LOCK_ACQUIRE_CAUSES_WAKEUP#

Type: Number

Turn the screen on when the wake lock is acquired.

WAKE_LOCK_FULL#

Type: Number

Ensures that the screen and keyboard backlight are on at full brightness.

WAKE_LOCK_ON_AFTER_RELEASE#

Type: Number

When this wake lock is released, poke the user activity timer so the screen stays on for a little longer.

WAKE_LOCK_PARTIAL#

Type: Number

Ensures that the CPU is running; the screen and keyboard backlight will be allowed to go off.

WAKE_LOCK_SCREEN_BRIGHT#

Type: Number

Ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off.

WAKE_LOCK_SCREEN_DIM#

Type: Number

Ensures that the screen is on (but may be dimmed); the keyboard backlight will be allowed to go off.

Methods #

addEventListener #

extended

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

Parameters:
NameTypeSummaryOptional
nameStringName of the event.No
callbackCallback<Titanium.Event>Callback function to invoke when the event is fired.No

applyProperties #

extended

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that
myproxy[key] = value.

Parameters:
NameTypeSummaryOptional
propsDictionaryA dictionary of properties to apply.No

createBroadcastIntent #

Create an Intent to be used in a broadcast.

Parameters:
NameTypeSummaryOptional
parametersDictionary<Titanium.Android.Intent>Properties to set on the new object, including any defined by
Titanium.Android.Intent, except those marked not-creation or read-only.
Yes

Returns: Titanium.Android.Intent

createIntentChooser #

Creates an activity chooser intent, used to allow the user to select a target activity
for an intent.

Use this method when the user wants to take an action that could use any one of a
number of applications. For example, when sending a plain text message, the user
may choose to send a text message, send an email, or post to a social network.

You pass in an Intent representing the action being taken,
and a title for the chooser.

The method returns another intent, representing the chooser, which can be used to
start an activity. See the code example for details on how to display the chooser.

For more information, see the official Android documentation for
Intent.ACTION_CHOOSER

Parameters:
NameTypeSummaryOptional
intentTitanium.Android.IntentThe intent to display a chooser for.No
titleStringTitle to display on the chooser.No

Returns: Titanium.Android.Intent

createPendingIntent #

Creates a PendingIntent to be used inside a
Notification.

If FLAG_NO_CREATE is specified and no matching pending intent exists, returns
null.

Parameters:
NameTypeSummaryOptional
parametersDictionary<Titanium.Android.PendingIntent>Properties to set on the new object, including any defined by
Titanium.Android.PendingIntent, except those marked not-creation or read-only.
Yes

Returns: Titanium.Android.PendingIntent

createService #

Create a Titanium.Android.Service so you can start/stop it and listen for events from it.

Parameters:
NameTypeSummaryOptional
intentTitanium.Android.IntentAn Intent created with createServiceIntent,
which specifies the service to be instantiated.
No

Returns: Titanium.Android.Service

createServiceIntent #

Create an Intent to be used to start a service.

Parameters:
NameTypeSummaryOptional
optionsServiceIntentOptionsOptions for the Service.No

Returns: Titanium.Android.Intent

fireEvent #

extended

Fires a synthesized event to any registered listeners.

Parameters:
NameTypeSummaryOptional
nameStringName of the event.No
eventDictionaryA dictionary of keys and values to add to the Titanium.Event object sent to the listeners.Yes

hasPermission #

Returns true if the app has permission access.

Parameters:
NameTypeSummaryOptional
permissionString, Array<String>The permission to check for access. This can be any of the constants listed here
with dangerous protection level here.
For example, android.permission.WRITE_CONTACTS.

Since Titanium 6.1.0, the method will also accept Array<String>
No

Returns: Boolean

isServiceRunning #

Check on state of Service.

Parameters:
NameTypeSummaryOptional
intentTitanium.Android.IntentAn Intent created with createServiceIntent,
which specifies the service to check.
No

Returns: Boolean

registerBroadcastReceiver #

Registers broadcast receiver for the given actions.

Parameters:
NameTypeSummaryOptional
broadcastReceiverTitanium.Android.BroadcastReceiverThe broadcast receiver to register and handle the broadcast.
No
actionsArray<String>The actions that the broadcast receiver will handle
No

removeEventListener #

extended

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

Multiple listeners can be registered for the same event, so the
callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function
in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);
Parameters:
NameTypeSummaryOptional
nameStringName of the event.No
callbackCallback<Titanium.Event>Callback function to remove. Must be the same function passed to addEventListener.No

requestPermissions #

Request for permission access.

Parameters:
NameTypeSummaryOptional
permissionsString, Array<String>The permission(s) to request for access. This can be any of the constants listed here
with dangerous protection level here.
Normal protection permissions are automatically enabled if they are included in the manifest. An example of a
dangerous protection permission would be android.permission.WRITE_CONTACTS.
The requested permission(s) MUST also be included in the Android Manifest.

Besides this, there are also requestPermission methods that are ready for commonly used situations. These methods are
Titanium.Calendar.requestCalendarPermissions, Titanium.Contacts.requestContactsPermissions,
Titanium.Filesystem.requestStoragePermissions, Titanium.Geolocation.requestLocationPermissions and Titanium.Media.requestCameraPermissions.

Since Titanium 6.1.0, the method will also accept a String. Any requests where permissions are already granted will yield a successful callback.
No
callbackCallback<RequestPermissionAccessResult>Function to call upon user decision to grant access.
Optional on SDK 10, as this method will return a Promise, which may be used to handle the result.
Yes

Returns: Promise<RequestPermissionAccessResult> — On SDK 10+, this method will return a `Promise` whose resolved value is equivalent to that passed to the optional callback argument.

startService #

Starts a simple service.

Parameters:
NameTypeSummaryOptional
intentTitanium.Android.IntentAn Intent created with createServiceIntent,
which specifies the service to start.
No

stopService #

Stop a simple service that was started with startService.

Parameters:
NameTypeSummaryOptional
intentTitanium.Android.IntentAn Intent created with createServiceIntent,
which specifies the service to stop.
No

unregisterBroadcastReceiver #

Unregisters a broadcast receiver.

Parameters:
NameTypeSummaryOptional
broadcastReceiverTitanium.Android.BroadcastReceiverThe broadcast receiver to unregister.
No

Titanium SDK Documentation