Developer

Store Usage Data

Records created using the Usage plugin APIs are stored automatically in a local database until they are successfully POSTed to the server.

Android and iOS Platforms

Data is stored in a SQLite database (plain text or encrypted).

Windows Platform

Data is stored using datavault, and Windows Data Protection API does the encryption. You cannot change the encryption key using the init or changeEncryptionKey methods, and calling them has no effect on data protection.

Optional Database Encryption

Optionally, you can encrypt the SQLite database containing the usage records on-device by using the Zetetic SQLCipher extension to SQLite. For more information about the Zetetic SQLCipher extension, see www.zetetic.net.

To enable encrypted mode, you need to use the init: method to set a password. For example:
sap.Usage.init = function(uploadEndpoint, dataEncryptionKey, timeFor3GUpload, successCallback, errorCallback)

Modifying the Database Encryption Key

You can modify the encryption key using a dedicated API call. For example:
sap.Usage.changeEncryptionKey(password, newPassword, successcallback, errorcallback)
After changing the encryption key, call all the subsequent init methods with the new password, even after you have restarted the application. This ensures that the password has been updated into a secure persistent store.