Giter Club home page Giter Club logo

Comments (7)

forrestguice avatar forrestguice commented on July 19, 2024

Hi. Thanks for reporting there's a problem. Its possible there is a bug here (wouldn't be the first time), or it could be an issue with your specific device.

The widget is supposed to update once a minute. If you are able to access your devices logcat, there should be a message every time the widget is (re)scheduled. Something like..

05-10 07:47:01.829 6421-6421/com.forrestguice.suntimes.naturalhour D/NaturalHourWidget: saveNextSuggestedUpdate: 7:48 AM
05-10 07:47:01.829 6421-6421/com.forrestguice.suntimes.naturalhour D/NaturalHourWidget_3x2: getUpdateTimeMillis: next update is at: 1652194081591

A few questions.. 1) What version Android are you running? (different behaviors for each). 2) When you notice the widget hasn't been updated, how stale is the info? Is it 10-15 minutes out of date, or hours, or maybe back to when the widget was added (never updated)? 3) Do you experience this bug when using the Suntimes widgets? (very similar code).

I can think of a few reasons the widget may not be updating. Supposing the app was ever force closed, the updates are stopped too. Its also possible the updates are scheduled but the OS is batching them to save battery - the widget would update every 15 to 20 minutes instead. Some phones are worse than others (https://dontkillmyapp.com/), but disabling battery optimization for the app would fix the widget.

from naturalhour.

forrestguice avatar forrestguice commented on July 19, 2024

All of the widgets schedule their updates the same way (by registering a PendingIntent with AlarmManager), so anything that disrupts that API effectively kills the widgets. So the potential reasons for a stale widget are numerous :\

from naturalhour.

Dambond avatar Dambond commented on July 19, 2024

I'm running android 9.
the widget is stuck at the last update (the last time I resized it)
I have not tried it yet with suntimes widjet.
"but disabling battery optimization for the app would fix the widget." it was enable...

from naturalhour.

forrestguice avatar forrestguice commented on July 19, 2024

@Dambond Thanks for the information. I'll keep this on the list. Whatever is causing the issue, once a widget fails once, it also fails to schedule future updates (breaking a chain). So there might be something more that can be done to help stale widgets recover.

Opening Suntimes -> Settings -> Widgets should trigger all widgets (including NaturalHour), restoring future updates. Afterward, I'm guessing the widget will update normally for some period, before whatever is causing the problem stops it again.

"but disabling battery optimization for the app would fix the widget." it was enable...

imho the Android battery optimization UI is confusing. All apps start on the "optimized" list (enabled), so you must scroll through a list of all apps, and then find and whitelist the specific app you want to "disable". In this context "enabled" actually means the system might stop the app at any time to save battery (but what actually happens really depends on the specific device).

from naturalhour.

Dambond avatar Dambond commented on July 19, 2024

I'm here with good news, it work now!
Sorry for not thinking about optimization.
Thank for your time!

from naturalhour.

Dambond avatar Dambond commented on July 19, 2024

I'm here with good news, it work now!
Sorry for not thinking about optimization.
Thank for your time!

Hum... I was wrong problem is back

from naturalhour.

forrestguice avatar forrestguice commented on July 19, 2024

Yeah, I figured it might be too soon to celebrate.
I think there might be an easy fix though, which I'll include in the next patch.

An unsigned debug build is available if you wanted to try it before then. From the green check mark next to the referenced commit click 'details', then 'summary' (left pane), then 'app' (under 'Artifacts').

from naturalhour.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.