Get Free Memory Size : Memory « Hardware « Android






Get Free Memory Size

  
import java.text.DecimalFormat;

class Main{
    /***
     * 
     * @return
     */
    public static long getFreeMemorySize() {
        
        long size = -1L;
        try {
            Runtime info = Runtime.getRuntime();
            size = info.freeMemory();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return size;
    }

}

   
    
  








Related examples in the same category

1.Get memory information
2.Get Memory Size Strings
3.Get Used Memory Size
4.Get Total Memory Size
5.Calculates the free memory of the device. This is based on an inspection of the filesystem, which in android devices is stored in RAM.
6.Calculates the total memory of the device. This is based on an inspection of the filesystem, which in android devices is stored in RAM.
7.Get Memory Total
8.Get Memory Free
9.get MemoryInfo
10.Memory information