@Override protected void onStart() { super.onStart(); connectionManager.connect(); SharedPreferences preferences = getSharedPreferences(SettingsFragment.PREF_TUT_MEASURE, 0); boolean showTutorial = preferences.getBoolean(SettingsFragment.PREF_TUT_MEASURE, true); Log.d("iris", "boolean" + showTutorial); // if all devices are already connecting, start measuring if (connectionManager.getConnectedDevices().size() == devices.size() && !showTutorial) { startMeasurement(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity_main); connectionManager = ConnectionManager.getInstance(this); connectionManager.setDevices(devices); connectionManager.setConnectionListener(this); evaluation = new HashMap<>(); // create a new evaluation instance for each trackable device for (BluetoothDevice device : devices) { evaluation.put(device, new MovingAverageEvaluation()); } }
@Override protected void onStop() { super.onStop(); stopMeasurement(); connectionManager.disconnect(); }