use of com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.ReadDataShare in project xDrip-plus by jamorham.
the class DexShareCollectionService method onCreate.
@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate: ENTER");
readData = new ReadDataShare(this);
service = this;
// KS foregroundServiceStarter = new ForegroundServiceStarter(getApplicationContext(), service);
// KS foregroundServiceStarter.start();
final IntentFilter bondintent = new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
registerReceiver(mPairReceiver, bondintent);
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
listenForChangeInSettings();
// KS bgToSpeech = BgToSpeech.setupTTS(getApplicationContext()); //keep reference to not being garbage collected
instance = JoH.ts();
}
use of com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.ReadDataShare in project xDrip by NightscoutFoundation.
the class ShareTest method attemptRead.
public void attemptRead() {
final ReadDataShare readData = new ReadDataShare(this);
final Action1<Long> systemTimeListener = new Action1<Long>() {
@Override
public void call(Long s) {
Log.d(TAG, "Made the full round trip, got " + s + " as the system time");
Log.d("SYSTTIME", "Made the full round trip, got " + s + " as the system time");
final long addativeSystemTimeOffset = new Date().getTime() - s;
Log.d(TAG, "Made the full round trip, got " + addativeSystemTimeOffset + " offset");
Log.d("SYSTTIME", "Made the full round trip, got " + addativeSystemTimeOffset + " offset");
final Action1<CalRecord[]> calRecordListener = new Action1<CalRecord[]>() {
@Override
public void call(CalRecord[] calRecords) {
Log.d(TAG, "Made the full round trip, got " + calRecords.length + " Cal Records");
Calibration.create(calRecords, addativeSystemTimeOffset, getApplicationContext());
final Action1<SensorRecord[]> sensorRecordListener = new Action1<SensorRecord[]>() {
@Override
public void call(SensorRecord[] sensorRecords) {
Log.d(TAG, "Made the full round trip, got " + sensorRecords.length + " Sensor Records");
BgReading.create(sensorRecords, addativeSystemTimeOffset, getApplicationContext());
final Action1<EGVRecord[]> evgRecordListener = new Action1<EGVRecord[]>() {
@Override
public void call(EGVRecord[] egvRecords) {
Log.d(TAG, "Made the full round trip, got " + egvRecords.length + " EVG Records");
BgReading.create(egvRecords, addativeSystemTimeOffset, getApplicationContext());
}
};
readData.getRecentEGVs(evgRecordListener);
}
};
readData.getRecentSensorRecords(sensorRecordListener);
}
};
readData.getRecentCalRecords(calRecordListener);
}
};
readData.readSystemTime(systemTimeListener);
}
use of com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.ReadDataShare in project xDrip by NightscoutFoundation.
the class DexShareCollectionService method onCreate.
@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate: ENTER");
readData = new ReadDataShare(this);
service = this;
// KS foregroundServiceStarter = new ForegroundServiceStarter(getApplicationContext(), service);
// KS foregroundServiceStarter.start();
final IntentFilter bondintent = new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
registerReceiver(mPairReceiver, bondintent);
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
listenForChangeInSettings();
// KS bgToSpeech = BgToSpeech.setupTTS(getApplicationContext()); //keep reference to not being garbage collected
instance = JoH.ts();
}
use of com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.ReadDataShare in project xDrip-plus by jamorham.
the class ShareTest method attemptRead.
public void attemptRead() {
final ReadDataShare readData = new ReadDataShare(this);
final Action1<Long> systemTimeListener = new Action1<Long>() {
@Override
public void call(Long s) {
Log.d(TAG, "Made the full round trip, got " + s + " as the system time");
Log.d("SYSTTIME", "Made the full round trip, got " + s + " as the system time");
final long addativeSystemTimeOffset = new Date().getTime() - s;
Log.d(TAG, "Made the full round trip, got " + addativeSystemTimeOffset + " offset");
Log.d("SYSTTIME", "Made the full round trip, got " + addativeSystemTimeOffset + " offset");
final Action1<CalRecord[]> calRecordListener = new Action1<CalRecord[]>() {
@Override
public void call(CalRecord[] calRecords) {
Log.d(TAG, "Made the full round trip, got " + calRecords.length + " Cal Records");
Calibration.create(calRecords, addativeSystemTimeOffset, getApplicationContext());
final Action1<SensorRecord[]> sensorRecordListener = new Action1<SensorRecord[]>() {
@Override
public void call(SensorRecord[] sensorRecords) {
Log.d(TAG, "Made the full round trip, got " + sensorRecords.length + " Sensor Records");
BgReading.create(sensorRecords, addativeSystemTimeOffset, getApplicationContext());
final Action1<EGVRecord[]> evgRecordListener = new Action1<EGVRecord[]>() {
@Override
public void call(EGVRecord[] egvRecords) {
Log.d(TAG, "Made the full round trip, got " + egvRecords.length + " EVG Records");
BgReading.create(egvRecords, addativeSystemTimeOffset, getApplicationContext());
}
};
readData.getRecentEGVs(evgRecordListener);
}
};
readData.getRecentSensorRecords(sensorRecordListener);
}
};
readData.getRecentCalRecords(calRecordListener);
}
};
readData.readSystemTime(systemTimeListener);
}
Aggregations