Skip to content

Commit 99ee421

Browse files
authored
document database updates
1 parent b121099 commit 99ee421

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,16 @@ snabble.setup(this, config, new Snabble.SetupCompletionListener() {
107107
// available offline
108108
project.getProductDatabase().loadDatabaseBundle("db.sqlite3", revision, major, minor);
109109
110-
// optional: download the latest product database for offline availability
110+
// recommended: download the latest product database for offline availability
111+
// it is highly recommended to call this in shorter time frames than config.maxProductDatabaseAge is set at
112+
// since the local database is only used if the time since the last update is smaller than
113+
// config.maxProductDatabaseAge, which defaults to 1 hour
114+
//
115+
// a good place for this is the onStart() method of your activity
116+
// database updates are usually very small since we are using delta updates for updating the database
117+
//
118+
// also a good place for database updates are background schedulers like
119+
// https://developer.android.com/topic/libraries/architecture/workmanager
111120
project.getProductDatabase().update();
112121
}
113122

0 commit comments

Comments
 (0)