2015-08-03 01:17:02 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.database;
|
|
|
|
|
|
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
|
|
import android.database.sqlite.SQLiteOpenHelper;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
2015-08-03 23:09:49 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
2015-09-24 14:45:21 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
|
2015-08-03 01:17:02 +02:00
|
|
|
|
|
|
|
public interface DBHandler {
|
2015-10-23 15:11:21 +02:00
|
|
|
SQLiteOpenHelper getHelper();
|
2015-08-03 01:17:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Releases the DB handler. No access may be performed after calling this method.
|
|
|
|
* Same as calling {@link GBApplication#releaseDB()}
|
|
|
|
*/
|
|
|
|
void release();
|
|
|
|
|
|
|
|
List<ActivitySample> getAllActivitySamples(int tsFrom, int tsTo, SampleProvider provider);
|
|
|
|
|
|
|
|
List<ActivitySample> getActivitySamples(int tsFrom, int tsTo, SampleProvider provider);
|
|
|
|
|
|
|
|
List<ActivitySample> getSleepSamples(int tsFrom, int tsTo, SampleProvider provider);
|
|
|
|
|
2016-02-29 20:54:39 +01:00
|
|
|
void addGBActivitySample(int timestamp, int provider, int intensity, int steps, int kind, int heartrate);
|
2015-08-03 01:17:02 +02:00
|
|
|
|
2015-10-23 16:18:36 +02:00
|
|
|
void addGBActivitySamples(ActivitySample[] activitySamples);
|
2015-10-23 15:11:21 +02:00
|
|
|
|
2015-08-03 01:17:02 +02:00
|
|
|
SQLiteDatabase getWritableDatabase();
|
2016-02-09 17:52:21 +01:00
|
|
|
|
2016-02-29 20:54:39 +01:00
|
|
|
void changeStoredSamplesType(int timestampFrom, int timestampTo, int kind, SampleProvider provider);
|
2016-02-09 17:52:21 +01:00
|
|
|
|
2016-02-11 19:14:40 +01:00
|
|
|
int fetchLatestTimestamp(SampleProvider provider);
|
|
|
|
|
2015-08-03 01:17:02 +02:00
|
|
|
}
|