| 1 |
gabriel |
1 |
package com.cesams.twogetskills.dao;
|
|
|
2 |
|
|
|
3 |
import android.content.Context;
|
|
|
4 |
|
|
|
5 |
import androidx.room.Room;
|
|
|
6 |
|
|
|
7 |
import com.cesams.twogetskills.Constants;
|
|
|
8 |
|
|
|
9 |
public class DatabaseHelper {
|
|
|
10 |
|
|
|
11 |
//Control de cambio de capsula
|
|
|
12 |
public static String CambioSlide = "NO"; // SI o NO
|
|
|
13 |
public static String ResumenVisores ="NO";
|
|
|
14 |
public static String imagenviewerontrol= "NO";
|
|
|
15 |
|
|
|
16 |
private static DatabaseHelper _INSTANCE = null;
|
|
|
17 |
private AppDatabase appDatabase;
|
|
|
18 |
|
|
|
19 |
// other instance variables can be here
|
|
|
20 |
|
|
|
21 |
private DatabaseHelper(Context context) {
|
|
|
22 |
appDatabase = Room.databaseBuilder(
|
|
|
23 |
context.getApplicationContext(),
|
|
|
24 |
AppDatabase.class, Constants.DATABASE_FILENAME
|
|
|
25 |
).allowMainThreadQueries().build();
|
|
|
26 |
};
|
|
|
27 |
|
|
|
28 |
public static DatabaseHelper getInstance(Context context) {
|
|
|
29 |
if (_INSTANCE == null) {
|
|
|
30 |
_INSTANCE = new DatabaseHelper(context);
|
|
|
31 |
}
|
|
|
32 |
return(_INSTANCE);
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
public AppDatabase getAppDatabase() {
|
|
|
36 |
return appDatabase;
|
|
|
37 |
}
|
|
|
38 |
}
|