FileDocCategorySizeDatePackage
Environment.javaAPI DocAndroid 1.5 API4090Wed May 06 22:41:56 BST 2009android.os

Environment

public class Environment extends Object
Provides access to environment variables.

Fields Summary
private static final File
ROOT_DIRECTORY
private static final File
DATA_DIRECTORY
private static final File
EXTERNAL_STORAGE_DIRECTORY
private static final File
DOWNLOAD_CACHE_DIRECTORY
public static final String
MEDIA_REMOVED
getExternalStorageState() returns MEDIA_REMOVED if the media is not present.
public static final String
MEDIA_UNMOUNTED
getExternalStorageState() returns MEDIA_UNMOUNTED if the media is present but not mounted.
public static final String
MEDIA_CHECKING
getExternalStorageState() returns MEDIA_CHECKING if the media is present and being disk-checked
public static final String
MEDIA_NOFS
getExternalStorageState() returns MEDIA_NOFS if the media is present but is blank or is using an unsupported filesystem
public static final String
MEDIA_MOUNTED
getExternalStorageState() returns MEDIA_MOUNTED if the media is present and mounted at its mount point with read/write access.
public static final String
MEDIA_MOUNTED_READ_ONLY
getExternalStorageState() returns MEDIA_MOUNTED_READ_ONLY if the media is present and mounted at its mount point with read only access.
public static final String
MEDIA_SHARED
getExternalStorageState() returns MEDIA_SHARED if the media is present not mounted, and shared via USB mass storage.
public static final String
MEDIA_BAD_REMOVAL
getExternalStorageState() returns MEDIA_BAD_REMOVAL if the media was removed before it was unmounted.
public static final String
MEDIA_UNMOUNTABLE
getExternalStorageState() returns MEDIA_UNMOUNTABLE if the media is present but cannot be mounted. Typically this happens if the file system on the media is corrupted.
Constructors Summary
Methods Summary
public static java.io.FilegetDataDirectory()
Gets the Android data directory.


              
        
        return DATA_DIRECTORY;
    
static java.io.FilegetDirectory(java.lang.String variableName, java.lang.String defaultPath)

        String path = System.getenv(variableName);
        return path == null ? new File(defaultPath) : new File(path);
    
public static java.io.FilegetDownloadCacheDirectory()
Gets the Android Download/Cache content directory.

        return DOWNLOAD_CACHE_DIRECTORY;
    
public static java.io.FilegetExternalStorageDirectory()
Gets the Android external storage directory.

        return EXTERNAL_STORAGE_DIRECTORY;
    
public static java.lang.StringgetExternalStorageState()
Gets the current state of the external storage device.


                  
        
        return SystemProperties.get("EXTERNAL_STORAGE_STATE", MEDIA_REMOVED);
    
public static java.io.FilegetRootDirectory()
Gets the Android root directory.


              
        
        return ROOT_DIRECTORY;