OpenSeizureDetector / Android_Pebble_SD

The main OpenSeizureDetector Android App, that is published on the Android Play Store.
http://openseizuredetector.org.uk
GNU General Public License v3.0
9 stars 11 forks source link

V4.2.x upstream #110

Closed AroonPro closed 1 year ago

AroonPro commented 1 year ago

Request to pull in state until 230701. Includes to check for closure of reported issues.

jones139 commented 1 year ago

Thanks - I'll merge it and try it out.

jones139 commented 1 year ago

Well, it is running without crashing on the emulator using the Phone data source, which is good :) StartUpActivity seems to work correctly (it seemed to take longer to receive data than I thought it should, but that could be an emulator issue). ...but once StartUpActivity exits and MainActivity starts, SdServer shuts down for some reason. MainActivity still says Server Running OK, but the task bar notification disappears and I can see it has called onDestroy in logcat.

AroonPro commented 1 year ago

That Server destruction is exactly an issue where i'm diving into.

The delay of finishing StartupActivity is in when is the first set of mSampleCount satisfied. Maybe I add a message on the first received sensor values.

This night I've been running with a extra off body sensor de- reactivation.

Next step is maybe a subtle beep from the phone, notification displayed and MainActivity showing not worn.

Battery life increased big time

Op za 1 jul. 2023 22:45 schreef Graham Jones @.***>:

Well, it is running without crashing on the emulator using the Phone data source, which is good :) StartUpActivity seems to work correctly (it seemed to take longer to receive data than I thought it should, but that could be an emulator issue). ...but once StartUpActivity exits and MainActivity starts, SdServer shuts down for some reason. MainActivity still says Server Running OK, but the task bar notification disappears and I can see it has called onDestroy in logcat.

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Android_Pebble_SD/pull/110#issuecomment-1616107885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV6J743RK7XGQPPK2ZDD6MDXOCD67ANCNFSM6AAAAAAZ2ZMKXQ . You are receiving this because you authored the thread.Message ID: @.***>

AroonPro commented 1 year ago

Watch battery life in this case

Op zo 2 jul. 2023 09:52 schreef Bram Regtien @.***>:

That Server destruction is exactly an issue where i'm diving into.

The delay of finishing StartupActivity is in when is the first set of mSampleCount satisfied. Maybe I add a message on the first received sensor values.

This night I've been running with a extra off body sensor de- reactivation.

Next step is maybe a subtle beep from the phone, notification displayed and MainActivity showing not worn.

Battery life increased big time

Op za 1 jul. 2023 22:45 schreef Graham Jones @.***>:

Well, it is running without crashing on the emulator using the Phone data source, which is good :) StartUpActivity seems to work correctly (it seemed to take longer to receive data than I thought it should, but that could be an emulator issue). ...but once StartUpActivity exits and MainActivity starts, SdServer shuts down for some reason. MainActivity still says Server Running OK, but the task bar notification disappears and I can see it has called onDestroy in logcat.

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Android_Pebble_SD/pull/110#issuecomment-1616107885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV6J743RK7XGQPPK2ZDD6MDXOCD67ANCNFSM6AAAAAAZ2ZMKXQ . You are receiving this because you authored the thread.Message ID: @.***>

jones139 commented 1 year ago

It might be a race condition doing the connection to the server.
I wonder if my waitForConnection works properly - if that did not really wait, what would happen? (https://github.com/OpenSeizureDetector/Android_Pebble_SD/blob/V4.2.x/app/src/main/java/uk/org/openseizuredetector/MainActivity.java#L483)

AroonPro commented 1 year ago

Ow yeah That is one thing I noticed. At my part I take it out, because an UI has an prohibition in invoking a wait. The mHandler.post is invoked, the function wait finishes, where the Runnable is invoked after the delay expires.

Here does the connect not get invoked after.

If we place the connect inside the wait after boolean isServerRunning is true, it might work.

Op zo 2 jul. 2023 14:22 schreef Graham Jones @.***>:

It might be a race condition doing the connection to the server. I wonder if my waitForConnection works properly - if that did not really wait, what would happen? ( https://github.com/OpenSeizureDetector/Android_Pebble_SD/blob/V4.2.x/app/src/main/java/uk/org/openseizuredetector/MainActivity.java#L483 )

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Android_Pebble_SD/pull/110#issuecomment-1616629456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV6J747CZIZQYFHYNP6ZMLTXOFRY5ANCNFSM6AAAAAAZ2ZMKXQ . You are receiving this because you authored the thread.Message ID: @.***>