You could write it:
base = sharedPrefs.getString(context.getString(R.string.key_server_name), context.getString(R.string.settings_server_default_server_name));