I need to find available and used RAM space.How can I find it using android code?I have used the following code to find total RAM.
public static String getTotalRAM() {
RandomAccessFile reader = null;
String load = null;
try {
reader = new RandomAccessFile("/proc/meminfo", "r");
load = reader.readLine();
Log.d("RAM ",""+load);
} catch (IOException ex) {
ex.printStackTrace();
} finally {
// Streams.close(reader);
}
return load;
}