Code example for ActivityManager.MemoryInfo

Methods: getMemoryInfo

		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))
		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();;
			ram = entry.getRam(timestamp);
			return ram;
Connect your IDE to all the code out there  Get Codota for Java