bailuk / AAT

Another Activity Tracker for Android
https://bailu.ch/aat
GNU General Public License v3.0
150 stars 41 forks source link

BLE Reconnect #61

Open arsab opened 4 years ago

arsab commented 4 years ago

When connection is lost with BLE sensor temporarly (e.g. increase distance and come back) we need to reconnect through user interfaces.

Would it make sense to reconnect through a periodic audit. e.g. periodically recall "updateConnections()" ? and how ? or detect loss and re trigger ?

arsab commented 4 years ago

I discover this nice application day after day. Realized that SensorStateButton helps to refresh connection. AAT/app/src/main/java/ch/bailu/aat/views/description/SensorStateButton.java

In interim I patched TrackerStateButton to tap few times to "react" on top of its main function in Cockpit display see below..

Maybe the best (lower battery impact) solution is to have a "Click" update with HR or Cadence number buttons (like altitude number button)

AAT/app/src/main/java/ch/bailu/aat/views/description/TrackerStateButton.java

@Override public void onClick(View v) { if (v==this) { new InsideContext(scontext) { @Override public void run() { scontext.getTrackerService().getState().onStartPauseResume(); } }; new InsideContext(scontext) { @Override public void run() { scontext.getSensorService().updateConnections(); } }; } }