Titanium.Android

Submodule of Titanium.
Platform Since
Android 1.5

Summary

The top level Android module. Ti.Android.currentActivity provides each context an Activity. This object cannot be created directly.

Description

Almost all of the constants defined in this module are directly taken from Android.
So if we've failed to document all of them, have a look online at the Android SDK reference pages.

The most important page there will be the Intent reference, which will give you the meaning of those ACTION, EXTRA and CATEGORY constants.

Objects

Name Summary
Titanium.Android.Activity

The Titanium binding of an Android Activity

Titanium.Android.Intent

The Titanium binding of an Android Intent

Titanium.Android.Menu

The Titanium binding of an Android Menu

Titanium.Android.MenuItem

The Titanium binding of an Android MenuItem

Titanium.Android.Notification

The Titanium binding of an Android Notification.

Titanium.Android.PendingIntent

The Titanium binding of an Android Pending Intent

Titanium.Android.R

The Titanium binding of android.R. Note that this accesses Android system-wide resources, not your application's resources. To access your application's resources, you want Titanium.App.Android.R.

Titanium.Android.RemoteViews

The Titanium binding of Android RemoteViews. RemoteViews are an API for referencing and updating views that live in another process (i.e. in a Titanium.Android.Notification)

Titanium.Android.Service

The Titanium binding of an Android Service. Can be used to start/stop the service directly and listen for service-specific events. In the Javascript-based services you write, this can be referenced with Titanium.Android.currentService. You can create an instance of the service with Titanium.Android.createService.

Methods

Name Summary
addEventListener

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

createBroadcastIntent

Create a Titanium.Android.Intent to be used to start a Broadcast.

createIntent

Create a Titanium.Android.Intent. Used to start other Activities and for marshaling data.

createIntentChooser

Display chooser interface to allow selection of desired target.

createNotification

Create a Titanium.Android.Notification. Used to notify the user of an event.

createPendingIntent

Create a Titanium.Android.PendingIntent to be used inside a Titanium.Android.Notification

createService

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

createServiceIntent

Create an Titanium.Android.Intent to be used to start a Service.

fireEvent

Fires a synthesized event to any registered listeners.

isServiceRunning

Check on state of Service.

removeEventListener

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

startService

Start a simple service

stopService

Stop a simple service that was started with startService.

Properties

Name Type Summary
ACTION_AIRPLANE_MODE_CHANGED String read-only
ACTION_ALL_APPS String read-only
ACTION_ANSWER String read-only
ACTION_ATTACH_DATA String read-only
ACTION_BATTERY_CHANGED String read-only
ACTION_BATTERY_LOW String read-only
ACTION_BATTERY_OKAY String read-only
ACTION_BOOT_COMPLETED String read-only
ACTION_BUG_REPORT String read-only
ACTION_CALL String read-only
ACTION_CALL_BUTTON String read-only
ACTION_CAMERA_BUTTON String read-only
ACTION_CHOOSER String read-only
ACTION_CLOSE_SYSTEM_DIALOGS String read-only
ACTION_CONFIGURATION_CHANGED String read-only
ACTION_CREATE_SHORTCUT String read-only
ACTION_DATE_CHANGED String read-only
ACTION_DEFAULT String read-only
ACTION_DELETE String read-only
ACTION_DEVICE_STORAGE_LOW String read-only
ACTION_DIAL String read-only
ACTION_EDIT String read-only
ACTION_GET_CONTENT String read-only
ACTION_GTALK_SERVICE_CONNECTED String read-only
ACTION_GTALK_SERVICE_DISCONNECTED String read-only
ACTION_HEADSET_PLUG String read-only
ACTION_INPUT_METHOD_CHANGED String read-only
ACTION_INSERT String read-only
ACTION_INSERT_OR_EDIT String read-only
ACTION_MAIN String read-only
ACTION_MANAGE_PACKAGE_STORAGE String read-only
ACTION_MEDIA_BAD_REMOVAL String read-only
ACTION_MEDIA_BUTTON String read-only
ACTION_MEDIA_CHECKING String read-only
ACTION_MEDIA_EJECT String read-only
ACTION_MEDIA_MOUNTED String read-only
ACTION_MEDIA_NOFS String read-only
ACTION_MEDIA_REMOVED String read-only
ACTION_MEDIA_SCANNER_FINISHED String read-only
ACTION_MEDIA_SCANNER_SCAN_FILE String read-only
ACTION_MEDIA_SCANNER_STARTED String read-only
ACTION_MEDIA_SHARED String read-only
ACTION_MEDIA_UNMOUNTABLE String read-only
ACTION_MEDIA_UNMOUNTED String read-only
ACTION_NEW_OUTGOING_CALL String read-only
ACTION_PACKAGE_ADDED String read-only
ACTION_PACKAGE_CHANGED String read-only
ACTION_PACKAGE_DATA_CLEARED String read-only
ACTION_PACKAGE_INSTALL String read-only
ACTION_PACKAGE_REMOVED String read-only
ACTION_PACKAGE_REPLACED String read-only
ACTION_PACKAGE_RESTARTED String read-only
ACTION_PICK String read-only
ACTION_PICK_ACTIVITY String read-only
ACTION_POWER_CONNECTED String read-only
ACTION_POWER_DISCONNECTED String read-only
ACTION_POWER_USAGE_SUMMARY String read-only
ACTION_PROVIDER_CHANGED String read-only
ACTION_REBOOT String read-only
ACTION_RUN String read-only
ACTION_SCREEN_OFF String read-only
ACTION_SCREEN_ON String read-only
ACTION_SEARCH String read-only
ACTION_SEARCH_LONG_PRESS String read-only
ACTION_SEND String read-only
ACTION_SENDTO String read-only
ACTION_SEND_MULTIPLE String read-only
ACTION_SET_WALLPAPER String read-only
ACTION_SHUTDOWN String read-only
ACTION_SYNC String read-only
ACTION_SYSTEM_TUTORIAL String read-only
ACTION_TIME_CHANGED String read-only
ACTION_TIME_TICK String read-only
ACTION_UID_REMOVED String read-only
ACTION_UMS_CONNECTED String read-only
ACTION_UMS_DISCONNECTED String read-only
ACTION_USER_PRESENT String read-only
ACTION_VIEW String read-only
ACTION_VOICE_COMMAND String read-only
ACTION_WALLPAPER_CHANGED String read-only
ACTION_WEB_SEARCH String read-only
CATEGORY_ALTERNATIVE String read-only
CATEGORY_BROWSABLE String read-only
CATEGORY_DEFAULT String read-only
CATEGORY_DEVELOPMENT_PREFERENCE String read-only
CATEGORY_EMBED String read-only
CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST String read-only
CATEGORY_HOME String read-only
CATEGORY_INFO String read-only
CATEGORY_LAUNCHER String read-only
CATEGORY_MONKEY String read-only
CATEGORY_OPENABLE String read-only
CATEGORY_PREFERENCE String read-only
CATEGORY_SAMPLE_CODE String read-only
CATEGORY_SELECTED_ALTERNATIVE String read-only
CATEGORY_TAB String read-only
CATEGORY_TEST String read-only
CATEGORY_UNIT_TEST String read-only
DEFAULT_ALL Number

Use all default values (where applicable). read-only

DEFAULT_LIGHTS Number

Use the default notification lights. read-only

DEFAULT_SOUND Number

Use the default notification sound. read-only

DEFAULT_VIBRATE Number

Use the default notification vibrate. read-only

EXTRA_ALARM_COUNT String read-only
EXTRA_BCC String read-only
EXTRA_CC String read-only
EXTRA_DATA_REMOVED String read-only
EXTRA_DONT_KILL_APP String read-only
EXTRA_EMAIL String read-only
EXTRA_INTENT String read-only
EXTRA_KEY_EVENT String read-only
EXTRA_PHONE_NUMBER String read-only
EXTRA_REPLACING String read-only
EXTRA_SHORTCUT_ICON String read-only
EXTRA_SHORTCUT_ICON_RESOURCE String read-only
EXTRA_SHORTCUT_INTENT String read-only
EXTRA_SHORTCUT_NAME String read-only
EXTRA_STREAM String read-only
EXTRA_SUBJECT String read-only
EXTRA_TEMPLATE String read-only
EXTRA_TEXT String read-only
EXTRA_TITLE String read-only
EXTRA_UID String read-only
FILL_IN_ACTION Number read-only
FILL_IN_CATEGORIES Number read-only
FILL_IN_COMPONENT Number read-only
FILL_IN_DATA Number read-only
FILL_IN_PACKAGE Number read-only
FLAG_ACTIVITY_BROUGHT_TO_FRONT Number read-only
FLAG_ACTIVITY_CLEAR_TOP Number read-only
FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET Number read-only
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS Number read-only
FLAG_ACTIVITY_FORWARD_RESULT Number read-only
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY Number read-only
FLAG_ACTIVITY_MULTIPLE_TASK Number read-only
FLAG_ACTIVITY_NEW_TASK Number read-only
FLAG_ACTIVITY_NO_ANIMATION Number read-only
FLAG_ACTIVITY_NO_HISTORY Number read-only
FLAG_ACTIVITY_NO_USER_ACTION Number read-only
FLAG_ACTIVITY_PREVIOUS_IS_TOP Number read-only
FLAG_ACTIVITY_REORDER_TO_FRONT Number read-only
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED Number read-only
FLAG_ACTIVITY_SINGLE_TOP Number read-only
FLAG_AUTO_CANCEL Number

Bit to be bitwise-ored into the flags field that should be set if the notification should be canceled when it is clicked by the user. read-only

FLAG_CANCEL_CURRENT Number read-only
FLAG_DEBUG_LOG_RESOLUTION Number read-only
FLAG_FROM_BACKGROUND Number read-only
FLAG_GRANT_READ_URI_PERMISSION Number read-only
FLAG_GRANT_WRITE_URI_PERMISSION Number read-only
FLAG_INSISTENT Number

Bit to be bitwise-ored into the flags field that if set, the audio will be repeated until the notification is cancelled or the notification window is opened. read-only

FLAG_NO_CLEAR Number

Bit to be bitwise-ored into the flags field that should be set if the notification should not be canceled when the user clicks the Clear all button. read-only

FLAG_NO_CREATE Number read-only
FLAG_ONE_SHOT Number read-only
FLAG_ONGOING_EVENT Number

Bit to be bitwise-ored into the flags field that should be set if this notification is in reference to something that is ongoing, like a phone call. read-only

FLAG_ONLY_ALERT_ONCE Number

Bit to be bitwise-ored into the flags field that should be set if you want the sound and/or vibration play each time the notification is sent, even if it has not been canceled before that. read-only

FLAG_RECEIVER_REGISTERED_ONLY Number read-only
FLAG_SHOW_LIGHTS Number

Bit to be bitwise-ored into the flags field that should be set if you want the LED on for this notification. read-only

FLAG_UPDATE_CURRENT Number read-only
PENDING_INTENT_FOR_ACTIVITY Number read-only
PENDING_INTENT_FOR_BROADCAST Number read-only
PENDING_INTENT_FOR_SERVICE Number read-only
PENDING_INTENT_MAX_VALUE Number read-only
R Object

Accessor for android resources read-only

RESULT_CANCELED Number read-only
RESULT_FIRST_USER Number read-only
RESULT_OK Number read-only
SCREEN_ORIENTATION_BEHIND Number read-only
SCREEN_ORIENTATION_LANDSCAPE Number read-only
SCREEN_ORIENTATION_NOSENSOR Number read-only
SCREEN_ORIENTATION_PORTRAIT Number read-only
SCREEN_ORIENTATION_SENSOR Number read-only
SCREEN_ORIENTATION_UNSPECIFIED Number read-only
SCREEN_ORIENTATION_USER Number read-only
STREAM_DEFAULT Number

Use this constant as the value for audioStreamType to request that the default stream type for notifications be used. read-only

URI_INTENT_SCHEME Number read-only

Events

This type has no events.