public class MemoryManager
extends java.lang.Object
This manager allows applications to obtain different memory values of the system.
Unless noted, all memory API methods require the
com.digi.android.permission.MEMORY
permission. If your application
does not have this permission it will not have access to any memory service
feature.
Constructor | Description |
---|---|
MemoryManager(android.content.Context context) |
Class constructor.
|
Modifier and Type | Method | Description |
---|---|---|
long |
getAvailableMemory() |
Returns the current system available memory in kB.
|
long |
getCachedMemory() |
Returns the current system cached memory in kB.
|
long |
getFreeMemory() |
Returns the current system free memory in kB.
|
long |
getTotalMemory() |
Returns the system total memory in kB.
|
public MemoryManager(android.content.Context context)
Instantiates a new object of type MemoryManager
with the given
context.
context
- The context to get the internal Memory service.java.lang.NullPointerException
- If context == null
.public long getTotalMemory() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.getAvailableMemory()
,
getCachedMemory()
,
getFreeMemory()
public long getFreeMemory() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.getAvailableMemory()
,
getCachedMemory()
,
getTotalMemory()
public long getCachedMemory() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.getAvailableMemory()
,
getFreeMemory()
,
getTotalMemory()
public long getAvailableMemory() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.getCachedMemory()
,
getFreeMemory()
,
getTotalMemory()