Android Guides | Samples

Android.OS.Environment Class

Provides access to environment variables.

See Also: Environment

Syntax

[Android.Runtime.Register("android/os/Environment", DoNotGenerateAcw=true)]
public class Environment : Object

Remarks

Provides access to environment variables.

[Android Documentation]

Requirements

Namespace: Android.OS
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.OS.Environment are listed below.

See Also: Object

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
MediaBadRemovalString. Storage state if the media was removed before it was unmounted.
const
MediaCheckingString. Storage state if the media is present and being disk-checked.
const
MediaMountedString. Storage state if the media is present and mounted at its mount point with read/write access.
const
MediaMountedReadOnlyString. Storage state if the media is present and mounted at its mount point with read-only access.
const
MediaNofsString. Storage state if the media is present but is blank or is using an unsupported filesystem.
const
MediaRemovedString. Storage state if the media is not present.
const
MediaSharedString. Storage state if the media is present not mounted, and shared via USB mass storage.
const
MediaUnknownString. Unknown storage state, such as when a path isn't backed by known storage media.
const
MediaUnmountableString. Storage state if the media is present but cannot be mounted.
const
MediaUnmountedString. Storage state if the media is present but not mounted.

Public Properties

[read-only]
static
DataDirectoryFile. Return the user data directory.
static
DirectoryAlarmsString. Standard directory in which to place any audio files that should be in the list of alarms that the user can select (not as regular music).
static
DirectoryDcimString. The traditional location for pictures and videos when mounting the device as a camera.
static
DirectoryDocumentsString. Standard directory in which to place documents that have been created by the user.
static
DirectoryDownloadsString. Standard directory in which to place files that have been downloaded by the user.
static
DirectoryMoviesString. Standard directory in which to place movies that are available to the user.
static
DirectoryMusicString. Standard directory in which to place any audio files that should be in the regular list of music for the user.
static
DirectoryNotificationsString. Standard directory in which to place any audio files that should be in the list of notifications that the user can select (not as regular music).
static
DirectoryPicturesString. Standard directory in which to place pictures that are available to the user.
static
DirectoryPodcastsString. Standard directory in which to place any audio files that should be in the list of podcasts that the user can select (not as regular music).
static
DirectoryRingtonesString. Standard directory in which to place any audio files that should be in the list of ringtones that the user can select (not as regular music).
[read-only]
static
DownloadCacheDirectoryFile. Return the download/cache content directory.
[read-only]
static
ExternalStorageDirectoryFile. Return the primary external storage directory.
[read-only]
static
ExternalStorageStateString. Returns the current state of the primary "external" storage device.
[read-only]
static
IsExternalStorageEmulatedBoolean. Returns whether the primary "external" storage device is emulated.
[read-only]
static
IsExternalStorageRemovableBoolean. Returns whether the primary "external" storage device is removable.
[read-only]
static
RootDirectoryFile. Return root of the "system" partition holding the core Android OS.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

static
GetExternalStoragePublicDirectory(String) : File
Get a top-level public external storage directory for placing files of a particular type.
static
GetExternalStorageState(File) : String
Returns the current state of the storage device that provides the given path.
static
GetStorageState(File) : String
static
InvokeIsExternalStorageEmulated(File) : Boolean
Returns whether the storage device that provides the given path is emulated.
static
InvokeIsExternalStorageRemovable(File) : Boolean
Returns whether the storage device that provides the given path is removable.