Code example for ActivityManager.MemoryInfo

Methods: getMemoryInfo

0
		return date.toString().substring(0, 19);
	} 
 
	// Returns the current ram used percentage. 
	private static String getCurrentRam(Context c) {
		MemoryInfo mi = new MemoryInfo();
		((ActivityManager) c.getSystemService(Activity.ACTIVITY_SERVICE))
				.getMemoryInfo(mi); 
		return String.valueOf(mi.availMem / 1048576L);
	} 
 
	// Returns RAM entry from database based on timestamp. 
	public static String getDbRam(Context c, String timestamp) {
		try { 
			Database entry = new Database(c);
			String ram = new String();
			entry.open();
			ram = entry.getRam(timestamp);
			entry.close();
			return ram;
Connect your IDE to all the code out there  Get Codota for Java