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 {
|
|
|
|
public SQLiteOpenHelper getHelper();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2015-08-15 00:23:13 +02:00
|
|
|
void addGBActivitySample(int timestamp, byte provider, short intensity, short steps, byte kind);
|
2015-08-03 01:17:02 +02:00
|
|
|
|
|
|
|
SQLiteDatabase getWritableDatabase();
|
|
|
|
}
|