Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/Improvement] Run the timer in the background #58

Closed
a-mabe opened this issue Aug 5, 2023 · 3 comments
Closed

[Feature/Improvement] Run the timer in the background #58

a-mabe opened this issue Aug 5, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@a-mabe
Copy link
Owner

a-mabe commented Aug 5, 2023

Purpose: As a user, I want the timer to continue running even if OpenHIIT isn't the currently active app.

More details: The timer should continue running even if another app becomes active. For example, if the user opens their music app during a workout the timer should continue counting down.

Acceptance Criteria:

  • When OpenHIIT is not the active app, the timer should continue counting down.
  • Sound effects should also play when OpenHIIT is not the currently active app.
@a-mabe a-mabe added the enhancement New feature or request label Aug 5, 2023
@a-mabe a-mabe moved this from Todo to In Progress in OpenHIIT Current Priorities Aug 26, 2023
@a-mabe
Copy link
Owner Author

a-mabe commented Sep 1, 2023

Work on the background timer is happening here: https://github.com/a-mabe/background_timer

The goal is to use the timer package as follows:

Countdown(
  controller: _controller,
  workSeconds: 8,
  restSeconds: 5,
  numberOfIntervals: 2,
  build: (_, int time) => Text(
    time.toString(),
    style: TextStyle(
      fontSize: 100,
    ),
  ),
  interval: Duration(milliseconds: 100),
  onFinished: () {

  },
),

@a-mabe
Copy link
Owner Author

a-mabe commented Sep 24, 2023

V/BackgroundService( 1987): Service already running, using existing service
D/AndroidRuntime( 1987): Shutting down VM
E/AndroidRuntime( 1987): FATAL EXCEPTION: main
E/AndroidRuntime( 1987): Process: com.codepup.workout_timer, PID: 1987
E/AndroidRuntime( 1987): java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.common.MethodChannel.invokeMethod(java.lang.String, java.lang.Object)' on a null object reference
E/AndroidRuntime( 1987): 	at id.flutter.flutter_background_service.BackgroundService$2.run(BackgroundService.java:238)
E/AndroidRuntime( 1987): 	at android.os.Handler.handleCallback(Handler.java:942)
E/AndroidRuntime( 1987): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1987): 	at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime( 1987): 	at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime( 1987): 	at android.app.ActivityThread.main(ActivityThread.java:7918)
E/AndroidRuntime( 1987): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 1987): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime( 1987): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@a-mabe a-mabe mentioned this issue Oct 14, 2023
6 tasks
@a-mabe a-mabe moved this from In Progress to Done in OpenHIIT Current Priorities Oct 25, 2023
@a-mabe
Copy link
Owner Author

a-mabe commented Oct 26, 2023

Closed in #70

@a-mabe a-mabe closed this as completed Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants