Directly read the property:
getResources().getInteger(android.R.integer.config_shortAnimTime);
getResources().getInteger(android.R.integer.config_mediumAnimTime);
getResources().getInteger(android.R.integer.config_longAnimTime);
Don’t use a hard-coded value: some devices provide an option to speed up animations: a hard-coded value would ignore that setting.