private void setSensorStatus(){ StringBuilder sensor_status= new StringBuilder(); if(Sensor.isActive()){ Sensor sens = Sensor.currentSensor(); Date date = new Date(sens.started_at); DateFormat df = new SimpleDateFormat(); sensor_status.append(df.format(date)); sensor_status.append(" ("); sensor_status.append((System.currentTimeMillis() - sens.started_at) / (1000 * 60 * 60 * 24)); sensor_status.append("d "); sensor_status.append(((System.currentTimeMillis() - sens.started_at) % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); sensor_status.append("h)"); } else { sensor_status.append("not available"); } sensor_status_view.setText(sensor_status.toString()); }
private void setSensorStatus(){ StringBuilder sensor_status= new StringBuilder(); if(Sensor.isActive()){ Sensor sens = Sensor.currentSensor(); Date date = new Date(sens.started_at); DateFormat df = new SimpleDateFormat(); sensor_status.append(df.format(date)); sensor_status.append(" ("); sensor_status.append((System.currentTimeMillis() - sens.started_at) / (1000 * 60 * 60 * 24)); sensor_status.append("d "); sensor_status.append(((System.currentTimeMillis() - sens.started_at) % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); sensor_status.append("h)"); } else { sensor_status.append("not available"); } sensor_status_view.setText(sensor_status.toString()); }
public static String status() { final StringBuilder sensor_status = new StringBuilder(); if (Sensor.isActive()) { final Sensor sensor = Sensor.currentSensor(); final Date date = new Date(sensor.started_at); DateFormat df = new SimpleDateFormat(); sensor_status.append(df.format(date)); sensor_status.append(" ("); sensor_status.append((tsl() - sensor.started_at) / Constants.DAY_IN_MS); sensor_status.append("d "); sensor_status.append(((tsl() - sensor.started_at) % Constants.DAY_IN_MS) / Constants.HOUR_IN_MS); sensor_status.append("h)"); } else { sensor_status.append("not available"); } return sensor_status.toString(); }
public static String status() { final StringBuilder sensor_status = new StringBuilder(); if (Sensor.isActive()) { final Sensor sensor = Sensor.currentSensor(); final Date date = new Date(sensor.started_at); DateFormat df = new SimpleDateFormat(); sensor_status.append(df.format(date)); sensor_status.append(" ("); sensor_status.append((tsl() - sensor.started_at) / Constants.DAY_IN_MS); sensor_status.append("d "); sensor_status.append(((tsl() - sensor.started_at) % Constants.DAY_IN_MS) / Constants.HOUR_IN_MS); sensor_status.append("h)"); } else { sensor_status.append("not available"); } return sensor_status.toString(); }
public String toS() {//KS Gson gson = new GsonBuilder() .excludeFieldsWithoutExposeAnnotation() .registerTypeAdapter(Date.class, new DateTypeAdapter()) .serializeSpecialFloatingPointValues() .create(); Log.d("SENSOR", "Sensor toS uuid=" + this.uuid + " started_at=" + this.started_at + " active=" + this.isActive() + " battery=" + this.latest_battery_level + " location=" + this.sensor_location + " stopped_at=" + this.stopped_at); return gson.toJson(this); }
public String toS() {//KS Gson gson = new GsonBuilder() .excludeFieldsWithoutExposeAnnotation() .registerTypeAdapter(Date.class, new DateTypeAdapter()) .serializeSpecialFloatingPointValues() .create(); Log.d("SENSOR", "Sensor toS uuid=" + this.uuid + " started_at=" + this.started_at + " active=" + this.isActive() + " battery=" + this.latest_battery_level + " location=" + this.sensor_location + " stopped_at=" + this.stopped_at); return gson.toJson(this); }
static void syncBGTable2() { if (!Sensor.isActive()) return; new Thread() { @Override
static void syncBGTable2() { if (!Sensor.isActive()) return; new Thread() { @Override
public String toS() {//KS Gson gson = new GsonBuilder() .excludeFieldsWithoutExposeAnnotation() .registerTypeAdapter(Date.class, new DateTypeAdapter()) .serializeSpecialFloatingPointValues() .create(); Log.d("SENSOR", "Sensor toS uuid=" + this.uuid + " started_at=" + this.started_at + " active=" + this.isActive() + " battery=" + this.latest_battery_level + " location=" + this.sensor_location + " stopped_at=" + this.stopped_at); return gson.toJson(this); }
private void updateCurrentBgInfoForBtShare(TextView notificationText) { if ((android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)) { notificationText.setText(R.string.unfortunately_andoird_version_no_blueooth_low_energy); return; } String receiverSn = Pref.getString("share_key", "SM00000000").toUpperCase(); if (receiverSn.compareTo("SM00000000") == 0 || receiverSn.length() == 0) { notificationText.setText(R.string.please_set_dex_receiver_serial_number); return; } if (receiverSn.length() < 10) { notificationText.setText(R.string.double_check_dex_receiver_serial_number); return; } if (ActiveBluetoothDevice.first() == null) { notificationText.setText(R.string.now_pair_with_your_dexcom_share); return; } if (!Sensor.isActive()) { notificationText.setText(R.string.now_choose_start_sensor_in_settings); return; } displayCurrentInfo(); }
private void updateCurrentBgInfoForBtShare(TextView notificationText) { if ((android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)) { notificationText.setText(R.string.unfortunately_andoird_version_no_blueooth_low_energy); return; } String receiverSn = Pref.getString("share_key", "SM00000000").toUpperCase(); if (receiverSn.compareTo("SM00000000") == 0 || receiverSn.length() == 0) { notificationText.setText(R.string.please_set_dex_receiver_serial_number); return; } if (receiverSn.length() < 10) { notificationText.setText(R.string.double_check_dex_receiver_serial_number); return; } if (ActiveBluetoothDevice.first() == null) { notificationText.setText(R.string.now_pair_with_your_dexcom_share); return; } if (!Sensor.isActive()) { notificationText.setText(R.string.now_choose_start_sensor_in_settings); return; } displayCurrentInfo(); }
public void onClick(View v) { if (Sensor.isActive()) { SyncingService.startActionCalibrationCheckin(getApplicationContext()); Toast.makeText(getApplicationContext(), "Checked in all calibrations", Toast.LENGTH_LONG).show(); Intent tableIntent = new Intent(v.getContext(), Home.class); startActivity(tableIntent); finish(); } else { Log.d("CALIBRATION", "ERROR, sensor not active"); } } });
public void onClick(View v) { if (Sensor.isActive()) { SyncingService.startActionCalibrationCheckin(getApplicationContext()); Toast.makeText(getApplicationContext(), "Checked in all calibrations", Toast.LENGTH_LONG).show(); Intent tableIntent = new Intent(v.getContext(), Home.class); startActivity(tableIntent); finish(); } else { Log.d("CALIBRATION", "ERROR, sensor not active"); } } });
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if(Sensor.isActive() == false) { Intent intent = new Intent(this, StartNewSensor.class); startActivity(intent); finish(); } else { JoH.fixActionBar(this); setContentView(R.layout.activity_stop_sensor); button = (Button)findViewById(R.id.stop_sensor); addListenerOnButton(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if(Sensor.isActive() == false) { Intent intent = new Intent(this, StartNewSensor.class); startActivity(intent); finish(); } else { JoH.fixActionBar(this); setContentView(R.layout.activity_stop_sensor); button = (Button)findViewById(R.id.stop_sensor); addListenerOnButton(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!Sensor.isActive()) { JoH.fixActionBar(this); setContentView(R.layout.activity_start_new_sensor); button = (Button) findViewById(R.id.startNewSensor); //dp = (DatePicker)findViewById(R.id.datePicker); //tp = (TimePicker)findViewById(R.id.timePicker); addListenerOnButton(); } else { Intent intent = new Intent(this, StopSensor.class); startActivity(intent); finish(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!Sensor.isActive()) { JoH.fixActionBar(this); setContentView(R.layout.activity_start_new_sensor); button = (Button) findViewById(R.id.startNewSensor); //dp = (DatePicker)findViewById(R.id.datePicker); //tp = (TimePicker)findViewById(R.id.timePicker); addListenerOnButton(); } else { Intent intent = new Intent(this, StopSensor.class); startActivity(intent); finish(); } }
if (wear_integration) { DataMap dataMap = new DataMap(); Log.d(TAG, "Sensor sendSensorData uuid=" + sensor.uuid + " started_at=" + sensor.started_at + " active=" + Sensor.isActive() + " battery=" + sensor.latest_battery_level + " location=" + sensor.sensor_location + " stopped_at=" + sensor.stopped_at); String json = sensor.toS(); Log.d(TAG, "dataMap sendSensorData GSON: " + json);
if (wear_integration) { DataMap dataMap = new DataMap(); Log.d(TAG, "Sensor sendSensorData uuid=" + sensor.uuid + " started_at=" + sensor.started_at + " active=" + Sensor.isActive() + " battery=" + sensor.latest_battery_level + " location=" + sensor.sensor_location + " stopped_at=" + sensor.stopped_at); String json = sensor.toS(); Log.d(TAG, "dataMap sendSensorData GSON: " + json);
public void onClick(final View v) { if ((Sensor.isActive() || Home.get_follower())) { final EditText value = (EditText) findViewById(R.id.bg_value); final String string_value = value.getText().toString();