Returns the available external memory size. Returns -1 if the external memory is unavailable.
AvailableInternalMemorySizeAsLong [read only]
Returns the available internal memory size.
AvailableMemoryAsLong [read only]
The total available memory on the system. This number should not be considered absolute: due to the nature of the kernel, a significant portion of this memory is actually in use and needed for the overall system to run well.
BatteryLevelAsString [read only]
Returns the battery level.
Registers the battery receiver. Call this before getBatteryLevel.
BoardAsString [read only]
Returns the name of the underlying board, like "goldfish".
BootloaderAsString [read only]
Returns the system bootloader version number. Since api level 8.
BrandAsString [read only]
Returns the brand (e.g., carrier) the software is customized for, if any.
This calculates the CPU usage. Return type: @return:
CodenameAsString [read only]
The current development codename, or the string "REL" if this is a release build. API level 4.
Makes a countdown timer from duration (in ms). 2 events are raised: eventname_ontick eventname_onfinish (OS as String)
CPUABIAsString [read only]
Returns the name of the instruction set (CPU type + ABI convention) of native code. Since api level 4.
CPUABI2AsString [read only]
Returns the name of the second instruction set (CPU type + ABI convention) of native code. Since api level 8.
The logical density of the display. This is a scaling factor for the Density Independent Pixel unit, where one DIP is one pixel on an approximately 160 dpi screen (for example a 240x320, 1.5"x2" screen), providing the baseline of the system's display. Thus on a 160dpi screen this density value will be 1; on a 120 dpi screen it would be .75; etc. This value does not exactly follow the real screen size (as given by xdpi and ydpi, but rather is used to scale the size of the overall UI in steps based on gross changes in the display dpi. For example, a 240x320 screen will have a density of 1 even if its width is 1.8", 1.3", etc. However, if the screen resolution is increased to 320x480 but the screen size remained 1.5"x2" then the density would be increased (probably to 1.5). Return type: @return:
The screen density expressed as dots-per-inch. May be either DENSITY_LOW, DENSITY_MEDIUM, or DENSITY_HIGH. http://developer.android.com/reference/android/util/DisplayMetrics.html#densityDpi Return type: @return:
DeviceAsString [read only]
Returns the name of the industrial design.
DisplayAsString [read only]
Returns a build ID string meant for displaying to the user API level 3
ElaspedCPUTimeAsLong [read only]
Returns elapsed milliseconds of the time this process has run.
Returns if the external memory is available.
FingerprintAsString [read only]
Returns a string that uniquely identifies this build. Do not attempt to parse this value.
formatSize (sizeAsLong) AsString
getAvailableBlocks (PathAsString) AsInt
The number of blocks that are free on the file system and available to applications.
getBlockCount (PathAsString) AsInt
The total number of blocks on the file system.
getBlockSize (PathAsString) AsInt
The size, in bytes, of a block on the file system.
getFreeBlocks (PathAsString) AsInt
The total number of blocks that are free on the file system, including reserved blocks (that are not available to normal applications).
getGidForName (nameAsString) AsInt
Returns the GID assigned to a particular user name, or -1 if there is none.
Return a list of the tasks that the user has recently launched, with the most recent being first and older ones after in order. maxNum: flags: Return type: @return:
getRunningServices (maxNumAsInt) Asjava.util.List
Return a list of the services that are currently running. maxNum The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many services are running. Return type: @return:
getRunningTasks (maxNumAsInt) Asjava.util.List
RReturn a list of the tasks that are currently running, with the most recent being first and older ones after in order. Note that "running" does not mean any of the task's code is currently loaded or activity -- the task may have been frozen by the system, so that it can be restarted in its previous state when next brought to the foreground. Return type: @return:
getUidForName (nameAsString) AsInt
Returns the UID assigned to a particular user name, or -1 if there is none.
Force the device to go to sleep. Overrides all the wake locks that are held
time is used to order this correctly with the wake lock calls. The time should be in the SystemClock.uptimeMillis() time base.
HardwareAsString [read only]
Returns the name of the hardware (from the kernel command line or /proc). API level 8.
The absolute height of the display in pixels. Return type: @return:
HostAsString [read only]
Returns the host.
IDAsString [read only]
Returns either a changelist number, or a label like "M4-rc20".
IncrementalAsString [read only]
The internal value used by the underlying source control to represent this build. E.g., a perforce changelist number or a git hash.
Initializes the Operating System Library.
Reboots the device in order to install the given update package.
Have the system immediately kill all background processes associated with the given package. packageName:
Kill the process with the given PID.
ManufacturerAsString [read only]
Returns the manufacturer of the product/hardware.
ModelAsString [read only]
Returns the end-user-visible name for the end product.
Returns the identifier of this process, which can be used with killProcess(int) and sendSignal(int, int).
Returns the identifier of this process's user.
Returns the identifier of the calling thread, which be used with setThreadPriority(int, int).
ydpi * heightPixels to calculate the Physical Height Screen. Return type: @return:
xdpi * widthPixels to calculate the Physical Width Screen Return type: @return:
ProductAsString [read only]
Returns the name of the overall product.
RadioAsString [read only]
Returns the name of the overall product. Api Level 8
Reads all info about the CPU. Return type: @return:
Reboot the device. Will not return if the reboot is successful. reason code to pass to the kernel (e.g., "recovery") to request special boot modes, or null. Api level 8
Reboots the device and wipes the user data partition.
ReleaseAsString [read only]
The user-visible version string. E.g., "1.0" or "3.4b5".
Perform a restat of the file system referenced by this object.
RunningAppProcessAsjava.util.List [read only]
Gets a list of all running application processess.
RunningAppProcessesAsjava.util.List [read only]
Returns a list of application processes that are running on the device.
Gives information about the running app processes. Declare and Initialize 3 lists list1: returns the process names. list2: returns the pid. list3: returns the process name and pid. Return type: @return:
Gives information about the running tasks. Declare and Initialize 3 lists list1: returns a unique id. list2: returns number of activities in this task. list3: returns number of activities that are currently running (not stopped and persisted) in this task. Return type: @return:
A scaling factor for fonts displayed on the display. This is the same as density, except that it may be adjusted in smaller increments at runtime based on a user preference for the font size. Return type: @return:
SDKAsInt [read only]
The user-visible SDK version of the framework
sendSignal (pidAsInt, signalAsInt)
Send a signal to the given process.
SerialAsString [read only]
Returns the name of the overall product. Api Level 9
Set to true if the system considers itself to currently be in a low memory situation.
setThreadPriority (tidAsInt, priorityAsInt)
Set the priority of a thread, based on Linux priorities.
Determine whether the current environment supports multiple processes.
TagsAsString [read only]
Returns Comma-separated tags describing the build, like "unsigned,debug".
ThresholdAsLong [read only]
The threshold of availMem at which we consider memory to be low and start killing background services and other non-extraneous processes.
TimeAsLong [read only]
Returns the time.
TotalExternalMemorySizeAsLong [read only]
Returns the available internal memory size. Returns -1 if the internal memory is unavailable.
User activity happened. Turns the device from whatever state it's in to full on, and resets the auto-off timer.
when is used to order this correctly with the wake lock calls. This time should be in the SystemClock.uptimeMillis() time base.
noChangeLights should be true if you don't want the lights to turn on because of this event. This is set when the power key goes down. We want the device to stay on while the button is down, but we're about to turn off. Otherwise the lights flash on and then off and it looks weird.
The absolute width of the display in pixels. Return type: @return:
The exact physical pixels per inch of the screen in the X dimension. Return type: @return:
The exact physical pixels per inch of the screen in the Y dimension Return type: @return: