Mega Code Archive

 
Categories / Android / Hardware
 

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;     } }