Environment Class

Definition

Provides access to environment variables.

[Android.Runtime.Register("android/os/Environment", DoNotGenerateAcw=true)]
public class Environment : Java.Lang.Object
[<Android.Runtime.Register("android/os/Environment", DoNotGenerateAcw=true)>]
type Environment = class
    inherit Object
Inheritance
Environment
Attributes

Remarks

Provides access to environment variables.

Java documentation for android.os.Environment.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Environment()
Environment(IntPtr, JniHandleOwnership)

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

Fields

MediaBadRemoval

Storage state if the media was removed before it was unmounted.

MediaChecking

Storage state if the media is present and being disk-checked.

MediaEjecting

Storage state if the media is in the process of being ejected.

MediaMounted

Storage state if the media is present and mounted at its mount point with read/write access.

MediaMountedReadOnly

Storage state if the media is present and mounted at its mount point with read-only access.

MediaNofs

Storage state if the media is present but is blank or is using an unsupported filesystem.

MediaRemoved

Storage state if the media is not present.

MediaShared

Storage state if the media is present not mounted, and shared via USB mass storage.

MediaUnknown

Unknown storage state, such as when a path isn't backed by known storage media.

MediaUnmountable

Storage state if the media is present but cannot be mounted.

MediaUnmounted

Storage state if the media is present but not mounted.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
DataDirectory

Return the user data directory.

DirectoryAlarms

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).

DirectoryAudiobooks

Standard directory in which to place any audio files that should be in the list of audiobooks that the user can select (not as regular music).

DirectoryDcim

The traditional location for pictures and videos when mounting the device as a camera.

DirectoryDocuments

Standard directory in which to place documents that have been created by the user.

DirectoryDownloads

Standard directory in which to place files that have been downloaded by the user.

DirectoryMovies

Standard directory in which to place movies that are available to the user.

DirectoryMusic

Standard directory in which to place any audio files that should be in the regular list of music for the user.

DirectoryNotifications

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).

DirectoryPictures

Standard directory in which to place pictures that are available to the user.

DirectoryPodcasts

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).

DirectoryRecordings

Standard directory in which to place any audio files that should be in the list of voice recordings recorded by voice recorder apps that the user can select (not as regular music).

DirectoryRingtones

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).

DirectoryScreenshots

Standard directory in which to place screenshots that have been taken by the user.

DownloadCacheDirectory

Return the download/cache content directory.

ExternalStorageDirectory

Return the primary shared/external storage directory.

ExternalStorageState

Returns the current state of the primary shared/external storage media.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsExternalStorageEmulated

Returns whether the primary shared/external storage media is emulated.

IsExternalStorageLegacy

Returns whether the shared/external storage media is a legacy view that includes files not owned by the app.

IsExternalStorageManager

Returns whether the calling app has All Files Access on the primary shared/external storage media.

IsExternalStorageRemovable

Returns whether the primary shared/external storage media is physically removable.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
RootDirectory

Return root of the "system" partition holding the core Android OS.

StorageDirectory

Return root directory where all external storage devices will be mounted.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetExternalStoragePublicDirectory(String)

Get a top-level shared/external storage directory for placing files of a particular type.

GetExternalStorageState(File)

Returns the current state of the shared/external storage media at the given path.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetStorageState(File)
Obsolete.

This member is deprecated.

InvokeIsExternalStorageEmulated(File)

Returns whether the shared/external storage media at the given path is emulated.

InvokeIsExternalStorageLegacy(File)

Returns whether the shared/external storage media is a legacy view that includes files not owned by the app.

InvokeIsExternalStorageManager(File)

Returns whether the calling app has All Files Access at the given path

InvokeIsExternalStorageRemovable(File)

Returns whether the shared/external storage media at the given path is physically removable.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to