Get Total Memory Size : Memory « Hardware « Android






Get Total Memory Size

  
import java.text.DecimalFormat;

class Main{
    /**
     *  
     */
    public static long getTotalMemorySize() {
        
        long size = -1L;
        try {
            Runtime info = Runtime.getRuntime();
            size = info.totalMemory();
        } 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 Free 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