starryalley / CSC_BLE_Bridge

Android app that bridges ANT+ Cycling Speed/Cadence/HR sensors as Bluetooth LE sensors
MIT License
65 stars 17 forks source link

Muiltiple Activity Instances #18

Closed Gaudon closed 2 years ago

Gaudon commented 3 years ago

Great project, really helped me out when relaying my ant+ only garmin watch to link with Zwift!

I've noticed 2 issues as of late.

  1. When minimizing the app to run as a service in the notification shade, resuming the activity often launches a new activity. This requires pressing back multiple times to get to the "active" activity that's actually enabled and transmitting information.
  2. Sometimes the app crashes on startup and becomes unresponsive. The only way to fix this I've seen is to uninstall and reinstall it. I haven't tried clearing app data yet, but it shouldn't be necessary.

This is done on a Samsung Galaxy S9 running Android 10.

starryalley commented 3 years ago

Thanks for the bug report. I did notice issue 1 myself but haven't seen issue 2 yet on my Samsung S8.

I haven't been riding on zwift lately (got a newborn in the house) so I haven't used this app in the past 2 or 3 months. I'll see what I can do to get this fixed when I have the time!

Gaudon commented 3 years ago

Thanks for the quick reply! I'm a software engineer myself, and thought about taking on a very similar project before finding this one. If I get a chance I'll look through the code, I have done some android development but it's not my area of expertise. If it looks obvious I'll just open a PR.

Cheers!

Gaudon commented 3 years ago

Screenshot_20210207-221456_CSC BLE Bridge

This picture shows that when launching the app from the notification service, the button for enabling BLE briding is clickable again (loses it's state). By clicking this (infinite times) you can launch additional activities / main screens. With this you have to press back a bunch to get to the "root" activity to actually cancel the bridging.

Gaudon commented 3 years ago

Screenshot_20210207-221354_CSC BLE Bridge

This one shows the app crashing. I don't really have a good way to reproduce this. If I start bridging, and then stop bridging (HR sensor) it seems to put the app in a crashed unresponsive state though. There may be other ways to accomplish this though.

ebiga commented 3 years ago

I can confirm bug 2 and cleaning app data/cache nor even restarting helps. App gets unresponsive. It worked for a couple of times before current status in which it cannot be used. I didn't try reinstalling. If there's any log file you want me to share, please let me know.

michaelrhughes commented 3 years ago

I ran into a similar issue when working on https://github.com/starryalley/CSC_BLE_Bridge/pull/20. I changed the communication to bind to the service and send messages along with a change to singleInstance for the activity. This way the Activity always binds to the service and gets the latest state from the service.

DJJo14 commented 2 years ago

20 is now merge in the master. Can there come a new release?

starryalley commented 2 years ago

Thanks @DJJo14. That awesome PR #20 indeed deserves a new release. Sorry I haven't worked on this for a long time. I've just released v1.3 here

starryalley commented 2 years ago

Closing as the latest v1.3.x release should have resolved this issue. Please reopen if not.