ProductDatabase
Class for interfacing with the local product database
Types
Link copied to clipboard
interface OnDatabaseUpdateListener
Link copied to clipboard
interface UpdateCallback
Functions
Link copied to clipboard
open fun addOnDatabaseUpdateListener(onDatabaseUpdateListener: ProductDatabase.OnDatabaseUpdateListener)
Adds a listener that gets called every time the database updates after calling update
Link copied to clipboard
Cancels a database update, if one is currently running.
Link copied to clipboard
Find a product via its scannable code.
Link copied to clipboard
open fun findByCodeOnline(scannedCode: ScannedCode, productAvailableListener: OnProductAvailableListener)
open fun findByCodeOnline(scannedCode: ScannedCode, productAvailableListener: OnProductAvailableListener, onlineOnly: Boolean)
Finds a product via its scannable code over the network, if the service is available.
Link copied to clipboard
Find a product by its name.
Link copied to clipboard
open fun findBySkuOnline(sku: String, productAvailableListener: OnProductAvailableListener, onlineOnly: Boolean)
Finds a product via its SKU over the network, if the service is available.
Link copied to clipboard
Find a product via its SKU.
Link copied to clipboard
Deprecated.
Link copied to clipboard
The current major schema version.
Link copied to clipboard
The current minor schema version.
Link copied to clipboard
Returns true if the product database is synchronized and available offline
Link copied to clipboard
Link copied to clipboard
Return true if the database was updated recently and can be used to display accurate prices.
Link copied to clipboard
Loads the a database from an InputStream.
Loads the a database from a file located int the assets folder.
Link copied to clipboard
Returns the current product where the cursor is currently pointing at.
Link copied to clipboard
open fun removeOnDatabaseUpdateListener(onDatabaseUpdateListener: ProductDatabase.OnDatabaseUpdateListener)
Removes an already added listener
Link copied to clipboard
Returns a Cursor which can be iterated for items containing the given scannable code or sku.
Link copied to clipboard
This function needs config value generateSearchIndex set to true Returns a Cursor which can be iterated for items containing the given search string at the start of a word.
Link copied to clipboard
Updates the current database in the background by requesting new data from the backend.