En mi aplicación actual de Android tengo varias configuraciones almacenadas en SharedPreferences y un objeto que maneja el acceso a ellas. Ahora me pregunto si tiene sentido para almacenar en caché los valores o no, si hace mucho mater acceder a ellos les gusta:¿Los valores de caché de SharedPreferences tienen sentido?
public final boolean isxxxEnabled() {
return preferences.getBoolean("xxx", false);
}
en lugar de
public final boolean isxxxEnabled() {
// check if value changed
// if not, check if value is cached
// decide whether to return cached or new
// cache value
return
}
¿Tiene alguna fuente para esto? – EmmanuelMess
Bien, [aquí] (https://stackoverflow.com/a/34684174/3124150) es una referencia. – EmmanuelMess