Code example for ActivityManager

Methods: getMemoryClass

0
    ActivityManager activityManager;
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        tvMemory.setText("当前设备中每个app可用内存为 " + activityManager.getMemoryClass() + " M");
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java