Context class

Interface to global information about an application environment.

This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.

See: https://developer.android.com/reference/android/content/Context

Constructors

Context()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Properties

cacheDir → Future<Directory>
Returns the absolute path to the application specific cache directory on the filesystem. [...]
read-only
codeCacheDir → Future<Directory>
Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code. [...]
read-only
dataDir → Future<Directory>
Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored. [...]
read-only
externalCacheDir → Future<Directory>
Returns absolute path to application-specific directory on the primary shared/external storage device where the application can place cache files it owns. These files are internal to the application, and not typically visible to the user as media. [...]
read-only
externalFilesDir → Future<Directory>
Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns. These files are internal to the applications, and not typically visible to the user as media. [...]
read-only
filesDir → Future<Directory>
Returns the absolute path to the directory on the filesystem where files created with openFileOutput(String, int) are stored. [...]
read-only
noBackupFilesDir → Future<Directory>
Returns the absolute path to the directory where files placed under this directory will be excluded from automatic backup to remote storage. [...]
read-only
packageCodePath → Future<File>
Return the full path to this context's primary Android package. The Android package is a ZIP file which contains application's primary code and assets. [...]
read-only
packageName → Future<String>
Return the name of this application's package. [...]
read-only
packageResourcePath → Future<File>
Return the full path to this context's primary Android package. The Android package is a ZIP file which contains the application's primary resources. [...]
read-only

Static Methods

getSharedPreferences(String name, [int mode = 0]) → Future<SharedPreferences>
Retrieves and holds the contents of the preferences file name, returning a SharedPreferences through which you can retrieve and modify its values. [...]
getSystemService(String name) → dynamic
Returns the handle to a system-level service by name. [...]

Constants

ACCESSIBILITY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#ACCESSIBILITY_SERVICE
'accessibility'
ACCOUNT_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#ACCOUNT_SERVICE
'account'
ACTIVITY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#ACTIVITY_SERVICE
'activity'
ALARM_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#ALARM_SERVICE
'alarm'
APP_OPS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#APP_OPS_SERVICE
'appops'
APPWIDGET_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#APPWIDGET_SERVICE
'appwidget'
AUDIO_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#AUDIO_SERVICE
'audio'
BATTERY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#BATTERY_SERVICE
'batterymanager'
BLUETOOTH_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#BLUETOOTH_SERVICE
'bluetooth'
CAMERA_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CAMERA_SERVICE
'camera'
CAPTIONING_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CAPTIONING_SERVICE
'captioning'
CARRIER_CONFIG_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CARRIER_CONFIG_SERVICE
'carrier_config'
CLIPBOARD_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CLIPBOARD_SERVICE
'clipboard'
COMPANION_DEVICE_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#COMPANION_DEVICE_SERVICE
'companiondevice'
CONNECTIVITY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CONNECTIVITY_SERVICE
'connectivity'
CONSUMER_IR_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CONSUMER_IR_SERVICE
'consumer_ir'
CROSS_PROFILE_APPS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#CROSS_PROFILE_APPS_SERVICE
'crossprofileapps'
DEVICE_POLICY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#DEVICE_POLICY_SERVICE
'device_policy'
DISPLAY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#DISPLAY_SERVICE
'display'
DOWNLOAD_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE
'download'
DROPBOX_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#DROPBOX_SERVICE
'dropbox'
EUICC_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#EUICC_SERVICE
'euicc'
FINGERPRINT_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#FINGERPRINT_SERVICE
'fingerprint'
HARDWARE_PROPERTIES_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE
'hardware_properties'
INPUT_METHOD_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#INPUT_METHOD_SERVICE
'input_method'
INPUT_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#INPUT_SERVICE
'input'
IPSEC_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#IPSEC_SERVICE
'ipsec'
JOB_SCHEDULER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#JOB_SCHEDULER_SERVICE
'jobscheduler'
KEYGUARD_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE
'keyguard'
LAUNCHER_APPS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#LAUNCHER_APPS_SERVICE
'launcherapps'
LAYOUT_INFLATER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#LAYOUT_INFLATER_SERVICE
'layout_inflater'
LOCATION_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#LOCATION_SERVICE
'location'
MEDIA_PROJECTION_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#MEDIA_PROJECTION_SERVICE
'media_projection'
MEDIA_ROUTER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#MEDIA_ROUTER_SERVICE
'media_router'
MEDIA_SESSION_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#MEDIA_SESSION_SERVICE
'media_session'
MIDI_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#MIDI_SERVICE
'midi'
NETWORK_STATS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#NETWORK_STATS_SERVICE
'netstats'
NFC_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#NFC_SERVICE
'nfc'
NOTIFICATION_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#NOTIFICATION_SERVICE
'notification'
NSD_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#NSD_SERVICE
'servicediscovery'
POWER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#POWER_SERVICE
'power'
See: https://developer.android.com/reference/android/content/Context#PRINT_SERVICE
'print'
RESTRICTIONS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#RESTRICTIONS_SERVICE
'restrictions'
SEARCH_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#SEARCH_SERVICE
'search'
SENSOR_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#SENSOR_SERVICE
'sensor'
SHORTCUT_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#SHORTCUT_SERVICE
'shortcut'
STORAGE_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#STORAGE_SERVICE
'storage'
STORAGE_STATS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#STORAGE_STATS_SERVICE
'storagestats'
SYSTEM_HEALTH_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#SYSTEM_HEALTH_SERVICE
'systemhealth'
TELECOM_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#TELECOM_SERVICE
'telecom'
TELEPHONY_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#TELEPHONY_SERVICE
'phone'
TELEPHONY_SUBSCRIPTION_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#TELEPHONY_SUBSCRIPTION_SERVICE
'telephony_subscription_service'
TEXT_CLASSIFICATION_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#TEXT_CLASSIFICATION_SERVICE
'textclassification'
TEXT_SERVICES_MANAGER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#TEXT_SERVICES_MANAGER_SERVICE
'textservices'
TV_INPUT_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#TV_INPUT_SERVICE
'tv_input'
UI_MODE_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#UI_MODE_SERVICE
'uimode'
USAGE_STATS_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#USAGE_STATS_SERVICE
'usagestats'
USB_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#USB_SERVICE
'usb'
USER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#USER_SERVICE
'user'
VIBRATOR_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE
'vibrator'
WALLPAPER_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE
'wallpaper'
WIFI_AWARE_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE
'wifiaware'
WIFI_P2P_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE
'wifip2p'
WIFI_RTT_RANGING_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#WIFI_RTT_RANGING_SERVICE
'wifirtt'
WIFI_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#WIFI_SERVICE
'wifi'
WINDOW_SERVICE → const String
See: https://developer.android.com/reference/android/content/Context#WINDOW_SERVICE
'window'