View on GitHub

sensibill-android-documentation

Caching Info

The main goal of this page is to give a bigger picture on the info being stored and how caching works on the SDK considering a few different contexts. E.g. how we use the userId for caching, how we store images of receipts when needed, etc.

User Identifier

UserIdentifier is a unique identifier used to index information stored by the SDK, as all information stored by the SDK is unique to a single user.

This information is stored in Encrypted SharedPreferences, and in the encrypted SQLLite Database.

Authentication Tokens

Tokens used when communicating with the Sensibill API server, and are provided to the SDK via the TokenProvider. These are necessary to be able to operate offline, and to speed up the startup process. User’s passwords are never stored.

This information is stored in Encrypted SharedPreferences.

Client Configuration

Each client has a set of configuration options, available through an API endpoint. This includes information such as enabled features, feature policies, and domain names.

These information are stored in SharedPreferences.

Receipt Images

These are the images of receipts taken through the device camera. They are stored for offline access, and to reduce network utilization.

These information are stored in an encrypted file system, under the /SensibillImages/ folder.

Receipt Detail Data

This is the detailed data extracted from a receipt by the Sensibill API service.

These are stored in an encrypted file system, under the /SensibillReceipts/ folder.

Network Transfer

In order to handle uploads at a later time if the network is not available, some information is temporarily stored until the upload requests can be completed.

For outbound requests, Android uses a local encrypted SQLLite database to store information before uploading to the Sensibill API service.

For inbound responses, Android uses OkHttpClient which uses standard HTTP caching policies to store network responses. These are stored in an encrypted file store, ANDROID_CACHE_DIR_PATH/sensibill/