-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathBackboneApplication.java
More file actions
44 lines (33 loc) · 1.6 KB
/
BackboneApplication.java
File metadata and controls
44 lines (33 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.researchstack.backboneapp;
import android.app.Application;
import com.jakewharton.threetenabp.AndroidThreeTen;
import org.researchstack.backbone.StorageAccess;
import org.researchstack.backbone.storage.database.AppDatabase;
import org.researchstack.backbone.storage.database.sqlite.DatabaseHelper;
import org.researchstack.backbone.storage.file.EncryptionProvider;
import org.researchstack.backbone.storage.file.FileAccess;
import org.researchstack.backbone.storage.file.PinCodeConfig;
import org.researchstack.backbone.storage.file.SimpleFileAccess;
import org.researchstack.backbone.storage.file.UnencryptedProvider;
public class BackboneApplication extends Application
{
@Override
public void onCreate()
{
super.onCreate();
// Customize your pin code preferences
PinCodeConfig pinCodeConfig = new PinCodeConfig(); // default pin config (4-digit, 1 min lockout)
// Customize encryption preferences
EncryptionProvider encryptionProvider = new UnencryptedProvider(); // No pin, no encryption
// If you have special file handling needs, implement FileAccess
FileAccess fileAccess = new SimpleFileAccess();
// If you have your own custom database, implement AppDatabase
AppDatabase database = new DatabaseHelper(this,
DatabaseHelper.DEFAULT_NAME,
null,
DatabaseHelper.DEFAULT_VERSION);
// initialize timezone database for JSR-310 library
AndroidThreeTen.init(this);
StorageAccess.getInstance().init(pinCodeConfig, encryptionProvider, fileAccess, database);
}
}